Comments (3)
Thanks for your report.
As written in the document, the next two lines are necessary when you use python2.
# coding: utf-8
from __future__ import unicode_literals
I'll modify the document to be clearer.
from pyknp.
Thanks for your report.
As written in the document, the next two lines are necessary when you use python2.
# coding: utf-8
from __future__ import unicode_literals
I'll modify the document to be clearer.
I only installed pyknp.I didn't install JUMAN++ and KNP.
I think this is not right.Is this version Python 3.6.4 valid?
In your document,you said python 2.7.15, 3.5.6, 3.6.6 is supported.
Can I use JUMAN++ in win10?
I use Python 3.6.4 |Anaconda 4.3.1
I modify the code like this:
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from pyknp import Juman
jumanpp = Juman() # default is JUMAN++: Juman(jumanpp=True). if you use JUMAN, use Juman(jumanpp=False)
result = jumanpp.analysis("お疲れさまです。今週のトップ報告を行います")
for mrph in result.mrph_list(): # 各形態素にアクセス
print("見出し:%s, 読み:%s, 原形:%s, 品詞:%s, 品詞細分類:%s, 活用型:%s, 活用形:%s, 意味情報:%s, 代表表記:%s" \
% (mrph.midasi, mrph.yomi, mrph.genkei, mrph.hinsi, mrph.bunrui, mrph.katuyou1, mrph.katuyou2, mrph.imis, mrph.repname))
But the error still exist.
Traceback (most recent call last):
File "E:/test/sub.py", line 5, in
result = jumanpp.analysis("お疲れさまです。今週のトップ報告を行います")
File "E:\Anaconda3\lib\site-packages\pyknp\juman\juman.py", line 87, in analysis
return self.juman(input_str)
File "E:\Anaconda3\lib\site-packages\pyknp\juman\juman.py", line 75, in juman
result = MList(self.juman_lines(input_str))
File "E:\Anaconda3\lib\site-packages\pyknp\juman\juman.py", line 70, in juman_lines
return self.subprocess.query(input_str, pattern=self.pattern)
File "E:\Anaconda3\lib\site-packages\pyknp\juman\process.py", line 71, in query
line = self.stdouterr.readline()[:-1].decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 7: invalid start byte
Where is wrong?
from pyknp.
The code is correct, and I can work it in my environment.
As you say, you have to install JUMAN++ (or JUMAN).
Please install it.
FYI, the latest JUMAN++ is here: https://github.com/ku-nlp/jumanpp
Btw, in the latest version in github, we check the existence of JUMAN/KNP.
You can install it as below.
% git clone https://github.com/ku-nlp/pyknp
% cd pyknp
% python setup.py install [--prefix=path]
from pyknp.
Related Issues (20)
- comment line with only S-ID infomation is ignored
- New pypi package release? HOT 1
- 特定の文章を入力された際にフリーズする現象
- IndexError caused HOT 1
- 述語項構造にNEの情報が付与されている場合,パースに失敗する HOT 4
- jumanpp 2.0.0-rc3でpyknp/juman/juman.pyのテストに失敗する HOT 1
- pas.cfidがNoneになることがある HOT 4
- UnicodeDecodeError: 'cp932' HOT 2
- AttributeError: 'NoneType' object has no attribute 'group' HOT 2
- ValueError: invalid literal for int() with base 10: '!!' HOT 2
- parse() returns empty result for a sentence without a punctuation
- consideration of parse process
- 複数スレッド間で `Juman` インスタンスを共有し analysis を実行すると確率的に処理が止まってしまう HOT 2
- KNP seems to ignore the `timeout` option HOT 9
- Documentation of pyknp (pyknp.readthedocs.io) shows no detailed information on knp HOT 1
- How to cite pyknp? HOT 5
- 照応解析(anaphora)オプションを付けると前の入力を読み続ける HOT 3
- jumanの出力が止まったとき無限ループに入る HOT 3
- Exception: Can't find JUMAN command: juman HOT 4
- Unable to tokenize sentences that start with at mark
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyknp.