pymorphy2
pymorphy2 copied to clipboard
Как подключить украинский словарь?
Добрый день!
Как подключить украинский словарь?
В доках сказано
morph = pymorphy2.MorphAnalyzer(lang='uk')
я установил так же словарь
pip install -U pymorphy2-dicts-uk
Запускаю и получаю
TypeError: __init__() got an unexpected keyword argument 'lang'
Запустив help(pymorphy2.MorphAnalyzer)
Узнаю что такой переменной нет, а есть новая переменная path
прописываю правильный путь
и получаю
No such file or directory: '/home/tytar/venv/lib/python3.4/site-packages/pymorphy2_dicts_uk/data/paradigm-prefixes.json'
Как оказыватся файла paradigm-prefixes.json нет в украинском словаре.
А если его скопировать из другого и запусть то опять ошибка
File "/home/tytar/venv/lib/python3.4/site-packages/pymorphy2/opencorpora_dict/storage.py", line 58, in load_dict prediction_prefixes = dawg.DAWG().load(_f('prediction-prefixes.dawg')) File "dawg.pyx", line 144, in dawg.DAWG.load (src/dawg.cpp:3851) OSError: It's not possible to read file stream
Как решить эту проблему?
И обновите доки, так как описаное в них подключение словаря не соотвествует действительности!
Добрый день! Поддержка украинского есть в pymorphy2 master; ее нет в pymorphy2 0.8, который сейчас лежит на pypi. Все должно заработать, если поставить pymorphy2 с гитхаба.
Спасибо большое!
Все заработало?
Я конечно на перед извиняюсь. А как библиотеку поставить с гитхаба? (ubuntu 16.04) Когда уже стоит версия что лежит на pypi. Это конечно смешно прозвучит, но в инете не нашел как это все замутить)
Это конечно смешно прозвучит, но в инете не нашел как это все замутить)
Да ладно первая ссылка по запросу pip install git
http://stackoverflow.com/questions/20101834/pip-install-from-github-repo-branch
Это конечно смешно прозвучит, но в инете не нашел как это все замутить) Да ладно первая ссылка по запросу pip install git http://stackoverflow.com/questions/20101834/pip-install-from-github-repo-branch
Оно заменит ту библиотеку что лежит на данный момент?
да
pip install git+https://github.com/kmike/pymorphy2.git
2017-01-11 23:36 GMT+02:00 skiesx [email protected]:
Это конечно смешно прозвучит, но в инете не нашел как это все замутить) Да ладно первая ссылка по запросу pip install git http://stackoverflow.com/questions/20101834/pip-install-from-github-repo- branch
Оно заменит ту библиотеку что лежит на данный момент?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kmike/pymorphy2/issues/80#issuecomment-272002410, or mute the thread https://github.com/notifications/unsubscribe-auth/AJXd1pzLUpQYs5yMp7yp-MlCOnAARscGks5rRUt2gaJpZM4LYH7l .
skiesx@*********:~$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymorphy2
>>> morph = pymorphy2.MorphAnalyzer(lang='uk')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'lang'
>>>
вот такое выдает. может знаете в чем проблема?
скинь вывод pip freeze
2017-01-11 23:57 GMT+02:00 skiesx [email protected]:
skiesx@*********:~$ python3 Python 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information.
import pymorphy2 morph = pymorphy2.MorphAnalyzer(lang='uk') Traceback (most recent call last): File "
", line 1, in TypeError: init() got an unexpected keyword argument 'lang' вот такое выдает. может знаете в чем проблема?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kmike/pymorphy2/issues/80#issuecomment-272008406, or mute the thread https://github.com/notifications/unsubscribe-auth/AJXd1tm8RDGvtYNxclyu6v1hVh7vheGWks5rRVBTgaJpZM4LYH7l .
спасибо. уже разобрался)
@kmike все работает. спасибо.
я сделал все так как вьіше, но у меня все равно пишет то же самое:
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymorphy2
>>> morph = pymorphy2.MorphAnalyzer(lang='uk')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'lang'
вьівод pip3 freeze:
appdirs==1.4.3
apturl==0.5.2
asn1crypto==0.24.0
beautifulsoup4==4.6.3
Brlapi==0.6.6
bs4==0.0.1
certifi==2018.8.24
chardet==3.0.4
command-not-found==0.3
cryptography==2.1.4
cssselect==1.0.3
cupshelpers==1.0
cycler==0.10.0
DAWG-Python==0.7.2
decorator==4.1.2
defer==1.0.6
distro-info==0.18
docopt==0.6.2
facebook-sdk==3.0.0
fake-useragent==0.1.10
future==0.16.0
httplib2==0.9.2
idna==2.7
kazam==1.4.5
keyring==10.6.0
keyrings.alt==3.0
language-selector==0.1
launchpadlib==1.10.6
lazr.restfulclient==0.13.5
lazr.uri==1.0.3
louis==3.5.0
lxml==4.2.5
macaroonbakery==1.1.3
Mako==1.0.7
MarkupSafe==1.0
matplotlib==2.1.1
numpy==1.13.3
oauth==1.0.1
olefile==0.45.1
parse==1.8.4
pexpect==4.2.1
Pillow==5.1.0
protobuf==3.0.0
pycairo==1.16.2
pycrypto==2.6.1
pycups==1.9.73
pyee==5.0.0
pygobject==3.26.1
pymacaroons==0.13.0
pymorphy2==0.8
pymorphy2-dicts==2.4.393442.3710985
pymorphy2-dicts-ru==2.4.404381.4453942
PyNaCl==1.1.2
pyparsing==2.2.0
pyppeteer==0.0.24
pyquery==1.4.0
pyRFC3339==1.0
python-apt==1.6.2
python-dateutil==2.6.1
python-debian==0.1.32
python-telegram-bot==10.1.0
pytz==2018.3
pyxdg==0.25
PyYAML==3.12
reportlab==3.4.0
requests==2.19.1
requests-html==0.9.0
requests-unixsocket==0.1.5
schedule==0.5.0
scipy==0.19.1
SecretStorage==2.3.1
selenium==3.14.0
simplejson==3.13.2
six==1.11.0
system-service==0.3
systemd-python==234
tqdm==4.26.0
ubuntu-drivers-common==0.0.0
ufw==0.35
unattended-upgrades==0.1
urllib3==1.23
usb-creator==0.3.3
w3lib==1.19.0
wadllib==1.3.2
websockets==6.0
wikipedia==1.4.0
xkit==0.0.0
zope.interface==4.3.2
OKAY сработал єтот ответ: https://groups.google.com/d/msg/pymorphy/0QMOKvvrEuQ/wM7iPiBABAAJ
Добрый день!
есть ли актуальный способ подключить украинский словарь?
я пробовала установить pymorphy2 с гитхаба, устанавливается только версия pymorphy2 0.8, которая при попытке задать аргумент lang='uk' при создании объекта класса MorphAnalyzer выдает ошибку
TypeError: __init__() got an unexpected keyword argument 'lang'
pip install git+https://github.com/kmike/pymorphy2.git pip install -U pymorphy2-dicts-uk