Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (9 sloc) 288 Bytes
from nltk.stem import WordNetLemmatizer
wnl = WordNetLemmatizer()
lem_cache = {}
def lem(word):
if word not in lem_cache:
lem_cache[word] = \
wnl.lemmatize(wnl.lemmatize(wnl.lemmatize(wnl.lemmatize(word), \
'v'), 'a'), 'r')
return lem_cache[word]