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
While exploring DictionaryBase.weightedParse() I found that after second iteration of inner for-loop ( DictionaryBase.java:148). suffix.toString() starts throwing StringIndexOutOfBoundsException.
You can make sure of that by inserting String s = suffix.toString(); after DictionaryBase.java:149 line. After that test DictExpansionTest.testIndependent() will fail.
After tiny exploration I found that it's happening because of bug(?) in CharSeqAdapter.copyToArray().
Does line start += this.start; make sense? In function CharSeqAdapter.charAt() we also do that operation. So we incrementing offset twice.
Because of that while incrementing start in for-loop in CharSeq.copyToArray() it goes out of the bound of initial delegate size.
I will provide a pull request if this would be confirmed.
The text was updated successfully, but these errors were encountered:
While exploring
DictionaryBase.weightedParse()
I found that after second iteration of inner for-loop ( DictionaryBase.java:148).suffix.toString()
starts throwing StringIndexOutOfBoundsException.You can make sure of that by inserting
String s = suffix.toString();
after DictionaryBase.java:149 line. After that testDictExpansionTest.testIndependent()
will fail.After tiny exploration I found that it's happening because of bug(?) in
CharSeqAdapter.copyToArray()
.Does line
start += this.start;
make sense? In functionCharSeqAdapter.charAt()
we also do that operation. So we incrementing offset twice.Because of that while incrementing
start
in for-loop inCharSeq.copyToArray()
it goes out of the bound of initial delegate size.I will provide a pull request if this would be confirmed.
The text was updated successfully, but these errors were encountered: