我不知道这如何与蟒蛇再装模式,但这个工作对我来说得到pattern.en工作在python 3.6:
git clone -b development https://github.com/clips/pattern
cd pattern
sudo python3.6 setup.py install
https://github.com/clips/pattern/issues/62
我不得不在安装过程中的一些SSL错误在我的Mac(10.11.6),其固定运行在Python代码(3.6):
import nltk
import ssl
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
pass
else:
ssl._create_default_https_context = _create_unverified_https_context
nltk.download('wordnet_ic')
显然有更好的办法处理SSL这样的东西FWIW: https://stackoverflow.com/a/41351871/8870055
健全检查:
[email protected] ~> python3.6
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from pattern.en import conjugate, lemma, lexeme, parse
>>>
>>> print(parse('ridden', relations=True, lemmata=True))
ridden/VBN/B-VP/O/O/ride
>>>
pattern.en终于在python3中运行了!
如果你想使用pip:在Anaconda命令提示符下,cd到C:\ Anaconda \ Scripts,并从那里使用pip。 –