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)
评论列表
文章目录