Correct ordercorrect order for wordform any/msd rendering

(most frequent first)
This commit is contained in:
Ozbolt Menegatti 2019-06-01 10:35:51 +02:00
parent 119b85568f
commit 0249ef1523

View File

@ -207,7 +207,7 @@ class WordFormAnyCR(ComponentRepresentation):
words_counter = []
for word in self.words:
words_counter.append((word.msd, word.lemma))
sorted_words = sorted(set(words_counter), key=words_counter.count)
sorted_words = sorted(set(words_counter), key=lambda x: -words_counter.count(x))
for word_msd, word_lemma in sorted_words:
if self.agreement is not None: