对于Python3:
git clone https://github.com/clips/pattern
cd pattern
git fetch
git checkout development
pip install mysqlclient
python setup.py install
然后
from pattern.en import conjugate, lemma, lexeme,PRESENT,SG
print (lemma('gave'))
print (lexeme('gave'))
print (conjugate(verb='give',tense=PRESENT,number=SG)) # he / she / it
产量
give ['give', 'gives', 'giving', 'gave', 'given'] gives
感谢@Agargara指点&Pattern的作者的出色工作,请支持他们;-)
0
使用NLTK和WordNet ,如何将简单的时态动词转换为现在,过去或过去分词形式?
例如:
我想编写一个函数,该函数以预期的形式给我动词,如下所示。