You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
同时打开命名实体识别和数量词识别,在切分“一分钟就累了”时会导致异常:
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("一分钟就累了");
步骤
首先……
然后……
接着……
触发代码
public void testIssue1234() throws Exception
{
CustomDictionary.add("用户词语");
System.out.println(StandardTokenizer.segment("触发问题的句子"));
}
期望输出
期望输出
实际输出
实际输出
其他信息
The text was updated successfully, but these errors were encountered:
注意事项
请确认下列注意事项:
版本号
当前最新版本号是: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("一分钟就累了");
步骤
触发代码
期望输出
实际输出
其他信息
The text was updated successfully, but these errors were encountered: