From 0249ef15232299c792c019e808d10ca4d87d2100 Mon Sep 17 00:00:00 2001 From: Ozbolt Menegatti Date: Sat, 1 Jun 2019 10:35:51 +0200 Subject: [PATCH] Correct ordercorrect order for wordform any/msd rendering (most frequent first) --- wani.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wani.py b/wani.py index 9a40078..d12b09c 100644 --- a/wani.py +++ b/wani.py @@ -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: