def singularize(noun):
"""
args
- noun : a noun e.g "man"
returns the singular form of the word if it finds one. Otherwise,
returns the word itself.
"""
singular = inflect.engine().singular_noun(noun)
if singular in ALL_WORDNET_WORDS:
return singular
return noun
评论列表
文章目录