word_forms.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:word_forms 作者: gutfeeling 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号