Closed 363325971 closed 7 years ago
print(pynlpir.version) 0.5.2
@363325971 Try running this in your terminal:
$ pynlpir update
@tsroten
import pynlpir pynlpir.open() [2017-06-23 10:11:17] Cannot open file /usr/local/lib/python2.7/site-packages/pynlpir/Data/NewWord.lst Cannot write log file /usr/local/lib/python2.7/site-packages/pynlpir/Data/20170623.err! pynlpir.segment('我们都是好朋友') [(u'\u6211\u4eec', u'pronoun'), (u'\u90fd', u'adverb'), (u'\u662f', u'verb'), (u'\u597d', u'adjective'), (u'\u670b\u53cb', u'noun')]
This is what I got from a segment, seems the result displays in unicode form
Yes, PyNLPIR returns Unicode, not bytes. You can print each Unicode string in the output to see it in the interpreter. Or you can call encode on the Unicode strings to encode them using your preferred encoding.
On Jun 22, 2017, at 21:18, 363325971 notifications@github.com wrote:
@tsroten
import pynlpir pynlpir.open() [2017-06-23 10:11:17] Cannot open file /usr/local/lib/python2.7/site-packages/pynlpir/Data/NewWord.lst Cannot write log file /usr/local/lib/python2.7/site-packages/pynlpir/Data/20170623.err! pynlpir.segment('我们都是好朋友') [(u'\u6211\u4eec', u'pronoun'), (u'\u90fd', u'adverb'), (u'\u662f', u'verb'), (u'\u597d', u'adjective'), (u'\u670b\u53cb', u'noun')]
This is what I got from a segment, seems the result displays in unicode form
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
2017-06-22 15:54:59] /usr/local/lib/python2.7/site-packages/pynlpir/Data/NLPIR.user Not valid license or your license expired! Please feel free to contact pipy_zhang@msn.com!
How to solve this?