passed posteriori instead of bag in get_ranked_words