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
警告: 自定义词典./work/data/dictionary/custom/CustomDictionary.txt缓存失败!
java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 2097152 out of bounds for int[1426181]
at java.base/java.lang.System.arraycopy(Native Method)
at com.hankcs.hanlp.collection.trie.DoubleArrayTrie.resize(DoubleArrayTrie.java:94)
at com.hankcs.hanlp.collection.trie.DoubleArrayTrie.build(DoubleArrayTrie.java:403)
at com.hankcs.hanlp.collection.trie.DoubleArrayTrie.build(DoubleArrayTrie.java:338)
at com.hankcs.hanlp.collection.trie.DoubleArrayTrie.build(DoubleArrayTrie.java:365)
at com.hankcs.hanlp.collection.trie.DoubleArrayTrie.build(DoubleArrayTrie.java:378)
at com.hankcs.hanlp.dictionary.CustomDictionary.loadMainDictionary(CustomDictionary.java:107)
at com.hankcs.hanlp.dictionary.CustomDictionary.loadMainDictionary(CustomDictionary.java:157)
at com.hankcs.hanlp.dictionary.CustomDictionary.reload(CustomDictionary.java:657)
at com.gildata.removal.Test_Hanlp.main(Test_Hanlp.java:21)
其他信息
希望能够指教一下
The text was updated successfully, but these errors were encountered:
注意事项
请确认下列注意事项:
版本号
当前最新版本号是:1.7.1
我使用的版本是:1.7.1
我的问题
在词库进行reload操作时出现数组溢出,在1.7.0版本中没有该问题。
是否和1.7.1修改reload生成自定义词典bin文件在重新载入时抛出异常ArrayIndexOutOfBoundsException #1028该问题有关
复现问题
步骤
`在CustomDictionary类的loadMainDictionary方法中dat.build(map);时发生异常。
经过跟踪发现在DoubleArrayTrie的
在System.arraycopy(base, 0, base2, 0, allocSize);中base做为拷贝源数据长度为1426181
base2的长度为2097152,而allocSize复制长度也为2097152,导致数据溢出
触发代码
期望输出
正常重载
实际输出
其他信息
希望能够指教一下
The text was updated successfully, but these errors were encountered: