它看起來像從,爲Python 3,模式僅在3.6支持的文檔和。 https://github.com/clips/pattern#installation
這個工作讓我得到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
我有我的Mac上安裝過程中的一些SSL錯誤(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')
顯然有一個bett呃方式來處理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終於在Python 3運行!
對不起,_interpreter_命中運行時錯誤。 – James