注意事项
请确认下列注意事项:
版本号
使用python3.7.1 版本, 直接pip 安装得到
Windows 10 家庭中文版1803 17134.376
当前最新版本号是:1.7.0
我使用的版本是:1.7.0
我的问题
在我使用pip 安装后, 在命令行运行hanlp segment 下载过jar和data后, 输入测试任意用句, 会出现报错信息.
复现问题
在我清空以前的hanlp文件后, 重新pip 安装, 没有对data 中的任何数据修改, 直接使用hanlp segment即出现问题.
触发代码
实际输出
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadDat
警告: 读取失败,问题发生在java.lang.ArrayIndexOutOfBoundsException: 7
at com.hankcs.hanlp.utility.ByteUtil.bytesHighFirstToInt(ByteUtil.java:239)
at com.hankcs.hanlp.corpus.io.ByteArray.nextInt(ByteArray.java:68)
at com.hankcs.hanlp.dictionary.CustomDictionary.loadDat(CustomDictionary.java:325)
at com.hankcs.hanlp.dictionary.CustomDictionary.loadMainDictionary(CustomDictionary.java:64)
at com.hankcs.hanlp.dictionary.CustomDictionary.<clinit>(CustomDictionary.java:51)
at com.hankcs.hanlp.seg.Segment.combineByCustomDictionary(Segment.java:203)
at com.hankcs.hanlp.seg.Viterbi.ViterbiSegment.segSentence(ViterbiSegment.java:57)
at com.hankcs.hanlp.seg.Segment.seg(Segment.java:557)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 没有加载到任何词条
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 自定义词典c:/program files/python37/lib/site-packages/pyhanlp/static/data/dictionary/custom/CustomDictionary.txt缓存失败!
java.lang.NullPointerException
at com.hankcs.hanlp.dictionary.CustomDictionary.loadMainDictionary(CustomDictionary.java:116)
at com.hankcs.hanlp.dictionary.CustomDictionary.<clinit>(CustomDictionary.java:51)
at com.hankcs.hanlp.seg.Segment.combineByCustomDictionary(Segment.java:203)
at com.hankcs.hanlp.seg.Viterbi.ViterbiSegment.segSentence(ViterbiSegment.java:57)
at com.hankcs.hanlp.seg.Segment.seg(Segment.java:557)
测试/vn 用/p 句/q
谢谢您的解答!
注意事项
请确认下列注意事项:
版本号
使用python3.7.1 版本, 直接pip 安装得到
Windows 10 家庭中文版1803 17134.376
当前最新版本号是:1.7.0
我使用的版本是:1.7.0
我的问题
在我使用pip 安装后, 在命令行运行
hanlp segment下载过jar和data后, 输入测试任意用句, 会出现报错信息.复现问题
在我清空以前的hanlp文件后, 重新pip 安装, 没有对data 中的任何数据修改, 直接使用hanlp segment即出现问题.
触发代码
实际输出
谢谢您的解答!