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

ArrayIndexOutOfBoundsException异常 #542

Closed
1 task done
nonego opened this issue May 24, 2017 · 0 comments
Closed
1 task done

ArrayIndexOutOfBoundsException异常 #542

nonego opened this issue May 24, 2017 · 0 comments

Comments

@nonego
Copy link

nonego commented May 24, 2017

注意事项

请确认下列注意事项:

  • 我已仔细阅读下列文档,都没有找到答案:
  • 我已经通过Googleissue区检索功能搜索了我的问题,也没有找到答案。
  • 我明白开源社区是出于兴趣爱好聚集起来的自由社区,不承担任何责任或义务。我会礼貌发言,向每一个帮助我的人表示感谢。
  • 我在此括号内输入x打钩,代表上述事项确认完毕。

版本号

当前最新版本号是:1.3.4
我使用的版本是:portable-1.3.4

我的问题

同时打开命名实体识别和数量词识别,在切分“一分钟就累了”时会导致异常:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 8
at com.hankcs.hanlp.seg.common.WordNet.add(WordNet.java:101)
at com.hankcs.hanlp.seg.common.WordNet.addAll(WordNet.java:201)
at com.hankcs.hanlp.seg.Viterbi.ViterbiSegment.segSentence(ViterbiSegment.java:97)
at com.hankcs.hanlp.seg.Segment.seg(Segment.java:498)

复现问题

同时打开命名实体识别和数量词识别,会导致异常。如下面代码:
Segment seg = HanLP.newSegment();
seg.enableAllNamedEntityRecognize(true);
seg.enableNumberQuantifierRecognize(true);
List list = seg.seg("一分钟就累了");

步骤

  1. 首先……
  2. 然后……
  3. 接着……

触发代码

    public void testIssue1234() throws Exception
    {
        CustomDictionary.add("用户词语");
        System.out.println(StandardTokenizer.segment("触发问题的句子"));
    }

期望输出

期望输出

实际输出

实际输出

其他信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant