swda.py 文件源码

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

项目:swda 作者: cgpotts 项目源码 文件源码
def __wn_lemmatize(self, lemma):
        """
        Lemmatize lemma using wordnet.stemWordNetLemmatizer(). Always
        returns a (string, pos) pair.  Lemmatizes even when the tag
        isn't helpful, by ignoring it for stemming.
        """
        string, tag = lemma
        wnl = WordNetLemmatizer()
        if tag in ('a', 'n', 'r', 'v'):
            string = wnl.lemmatize(string, tag)
        else:
            string = wnl.lemmatize(string)
        return (string, tag)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号