am 23e07c97: Merge "Fix: deleted PtNode handling in v403."
* commit '23e07c971b9c83607a7ac67b0ad56b6e03ed1535': Fix: deleted PtNode handling in v403.main
commit
33f44958a0
|
@ -97,6 +97,9 @@ int Ver4PatriciaTriePolicy::getWordId(const CodePointArrayView wordCodePoints,
|
|||
return NOT_A_WORD_ID;
|
||||
}
|
||||
const PtNodeParams ptNodeParams = mNodeReader.fetchPtNodeParamsInBufferFromPtNodePos(ptNodePos);
|
||||
if (ptNodeParams.isDeleted()) {
|
||||
return NOT_A_WORD_ID;
|
||||
}
|
||||
return ptNodeParams.getTerminalId();
|
||||
}
|
||||
|
||||
|
|
|
@ -746,7 +746,12 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase {
|
|||
assertTrue(binaryDictionary.isValidWord("aaa"));
|
||||
assertTrue(binaryDictionary.removeUnigramEntry("aaa"));
|
||||
assertFalse(binaryDictionary.isValidWord("aaa"));
|
||||
|
||||
onInputWord(binaryDictionary, "aaa", false /* isValidWord */);
|
||||
assertFalse(binaryDictionary.isValidWord("aaa"));
|
||||
onInputWord(binaryDictionary, "aaa", false /* isValidWord */);
|
||||
assertTrue(binaryDictionary.isValidWord("aaa"));
|
||||
assertTrue(binaryDictionary.removeUnigramEntry("aaa"));
|
||||
assertFalse(binaryDictionary.isValidWord("aaa"));
|
||||
binaryDictionary.close();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue