Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

同时开启标准分词和索引分词的数量词识别,然后索引数量词时发生数组越界异常. #10

Closed
a198720 opened this issue May 8, 2015 · 2 comments
Labels

Comments

@a198720
Copy link

a198720 commented May 8, 2015

测试代码:
public class TestHanLP {
@test
public void test1(){
StandardTokenizer.SEGMENT.enableNumberQuantifierRecognize(true);
IndexTokenizer.SEGMENT.enableNumberQuantifierRecognize(true);
List termList = StandardTokenizer.segment("此帐号有欠费业务是什么");
termList = IndexTokenizer.segment("此帐号有欠费业务是什么");
termList = StandardTokenizer.segment("15307971214话费还有多少");
termList = IndexTokenizer.segment("15307971214话费还有多少");
System.out.println(termList);
}
}
在对"此帐号有欠费业务是什么"分词时很正常.
对""15307971214话费还有多少"分词时发生数组越界异常错误.

异常错误:

java.lang.ArrayIndexOutOfBoundsException: 19
at com.hankcs.hanlp.seg.common.WordNet.get(WordNet.java:214)
at com.hankcs.hanlp.seg.WordBasedGenerativeModelSegment.decorateResultForIndexMode(WordBasedGenerativeModelSegment.java:489)
at com.hankcs.hanlp.seg.Viterbi.ViterbiSegment.segSentence(ViterbiSegment.java:105)
at com.hankcs.hanlp.seg.Segment.seg(Segment.java:291)
at com.hankcs.hanlp.tokenizer.IndexTokenizer.segment(IndexTokenizer.java:33)
at com.xin.file.FileTest.test4(FileTest.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)

@a198720
Copy link
Author

a198720 commented May 8, 2015

版本1.1.5中没有这种错误,今天升级为1.2.0时 发现的哈

hankcs added a commit that referenced this issue May 8, 2015
@hankcs
Copy link
Owner

hankcs commented May 8, 2015

感谢issue,1.2.1版已经修复了这个问题。

@hankcs hankcs closed this as completed May 8, 2015
@hankcs hankcs added the bug label May 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants