Skip to content

Commit

Permalink
Disable antonyms sort
Browse files Browse the repository at this point in the history
  • Loading branch information
ppizarror committed Nov 29, 2021
1 parent 75d39ca commit 1a10696
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion PyMultiDictionary/_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def antonym(self, lang: str, word: str, dictionary: str = DICT_SYNONYMCOM) -> An
for w in en_words:
if w not in words:
words.append(w)
words.sort()
# words.sort()

# else:
# raise InvalidDictionary(f'Dictionary {dictionary} cannot handle language {lang}')
Expand Down
2 changes: 1 addition & 1 deletion PyMultiDictionary/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ def __str__(self) -> str:
patch = property(lambda self: self[2])


vernum = Version(1, 1, 0)
vernum = Version(1, 1, 1)
ver = str(vernum)
rev = ''
20 changes: 12 additions & 8 deletions test/test_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,20 @@ def test_antonym(self) -> None:
self.assertRaises(InvalidLangCode, lambda: d.antonym('es', 'word'))

# Test downloaded from bs
ant = ['advisability', 'amicable', 'asset', 'best', 'better', 'bold', 'complimentary', 'courage',
'desirability', 'efficient', 'fragrant', 'good', 'goodness', 'inoffensive', 'joyful', 'morality',
'obedient', 'qualified', 'soundness', 'supportive', 'unalarming', 'uncritical', 'virtuous', 'worthiness']
ant = ['obedient', 'good', 'best', 'better', 'virtuous', 'morality',
'fragrant', 'unalarming', 'worthiness', 'desirability', 'advisability',
'goodness', 'asset', 'soundness', 'uncritical', 'amicable',
'complimentary', 'bold', 'supportive', 'efficient', 'courage',
'joyful', 'inoffensive', 'qualified']
self.assertEqual(d.antonym('en', 'bad'), ant)

ant = ['bad', 'badness', 'cold', 'cool', 'disobedience', 'domineering', 'evil', 'evilness', 'fidelity',
'fruitfulness', 'immoral', 'immorality', 'lowercase', 'maleficence', 'malignancy', 'malignity',
'naivete', 'nonpregnant', 'ordinary', 'passionless', 'unemotionality', 'unfavorable', 'unpropitious',
'unrespectable', 'unrighteous', 'unsoundness', 'unworthiness', 'unworthy', 'wicked', 'worse', 'worst',
'worthlessness', 'wrong']
ant = ['bad', 'worse', 'unfavorable', 'unrespectable', 'worst',
'unemotionality', 'passionless', 'immoral', 'evilness', 'wicked',
'unrighteous', 'unworthy', 'wrong', 'fruitfulness', 'naivete',
'fidelity', 'worthlessness', 'malignancy', 'evil', 'maleficence',
'immorality', 'malignity', 'lowercase', 'ordinary', 'disobedience',
'domineering', 'unpropitious', 'cold', 'cool', 'unworthiness',
'badness', 'unsoundness', 'nonpregnant']
self.assertEqual(d.antonym('en', 'good'), ant)

# Save soup example
Expand Down

0 comments on commit 1a10696

Please sign in to comment.