From: hankcs [mailto:notifications@github.com]
Sent: 2016年1月28日 21:14
To: hankcs/HanLP
Cc: yarayu
Subject: Re: [HanLP] python 调用时候出现的乱码问题 (#101)
请详细描述你的问题,附带示例代码和报错信息。
说明:
好几个demo例子运行时都会报“相应类库里缺少segment属性”
代码:
coding: utf-8
from jpype import *
import time
startJVM(getDefaultJVMPath(), "-Djava.class.path=D:\hanlp\hanlp-1.2.7.jar;D:\hanlp") # ,"-Xms1g"
demo11(日本人名识别)
HanLP = JClass('com.hankcs.hanlp.recognition.nr.JapanesePersonRecognition')
testCase = [
u"北川景子参演了林诣彬导演的《速度与激情3》",
u"林志玲亮相网友:确定不是波多野结衣?",
]
for line in testCase:
print HanLP.segment(line).toString()
报错:
print HanLP.segment(line).toString()
AttributeError: type object 'com.hankcs.hanlp.recognition.nr.JapanesePersonReco' has no attribute 'segment'
Reply to this email directly or view it on GitHub #101 (comment) .Image removed by sender.