Skip to content

Commit

Permalink
Fixed singularize function
Browse files Browse the repository at this point in the history
singular_noun(noun) returns False if the noun is already singular. We can use this to avoid having to check in ALL_WORDNET_WORDS and accidentally returning a boolean
  • Loading branch information
tomaarsen committed Sep 2, 2020
1 parent 4f848e4 commit 8a05104
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion word_forms/word_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def singularize(noun):
returns the word itself.
"""
singular = inflect.engine().singular_noun(noun)
if singular in ALL_WORDNET_WORDS:
if singular and singular in ALL_WORDNET_WORDS:
return singular
return noun

Expand Down

0 comments on commit 8a05104

Please sign in to comment.