The following produces an ArrayIndexOutOfBoundsException:
MapPatriciaTrie<Object> mpt = new MapPatriciaTrie<>();
mpt.insert("FOO");
mpt.get("F");
mpt.get("f");
MapDoubleArray<Object> mda = new MapDoubleArray<>(mpt);
mda.get("F");
mda.get("f"); // exception here
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at org.trie4j.bv.BytesRank1OnlySuccinctBitVector.isOne(BytesRank1OnlySuccinctBitVector.java:90)
at org.trie4j.bv.BytesRank1OnlySuccinctBitVector.get(BytesRank1OnlySuccinctBitVector.java:80)
at org.trie4j.doublearray.DoubleArray.getTermId(DoubleArray.java:243)
at org.trie4j.AbstractTermIdMapTrie.get(AbstractTermIdMapTrie.java:141)
I would expect this to simply return null rather than throw an exception. My use case is (natural-language) dictionary lookup with mixed-case keys.
The following produces an
ArrayIndexOutOfBoundsException
:I would expect this to simply return
null
rather than throw an exception. My use case is (natural-language) dictionary lookup with mixed-case keys.