Loading java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java +0 −9 Original line number Original line Diff line number Diff line Loading @@ -113,15 +113,6 @@ public abstract class DecayingExpandableBinaryDictionaryBase extends ExpandableB return false; return false; } } /** * Return whether the passed charsequence is in the dictionary. */ @Override public boolean isValidWord(final String word) { // Words included only in the user history should be treated as not in dictionary words. return false; } /** /** * Pair will be added to the decaying dictionary. * Pair will be added to the decaying dictionary. * * Loading native/jni/src/suggest/policyimpl/dictionary/dynamic_patricia_trie_policy.cpp +9 −2 Original line number Original line Diff line number Diff line Loading @@ -55,9 +55,16 @@ void DynamicPatriciaTriePolicy::createAndGetAllChildNodes(const DicNode *const d readingHelper.initWithPtNodeArrayPos(dicNode->getChildrenPos()); readingHelper.initWithPtNodeArrayPos(dicNode->getChildrenPos()); const DynamicPatriciaTrieNodeReader *const nodeReader = readingHelper.getNodeReader(); const DynamicPatriciaTrieNodeReader *const nodeReader = readingHelper.getNodeReader(); while (!readingHelper.isEnd()) { while (!readingHelper.isEnd()) { bool isTerminal = nodeReader->isTerminal() && !nodeReader->isDeleted(); if (isTerminal && mHeaderPolicy.isDecayingDict()) { // A DecayingDict may have a terminal PtNode that has a terminal DicNode whose // probability is NOT_A_PROBABILITY. In such case, we don't want to treat it as a // valid terminal DicNode. isTerminal = getProbability(nodeReader->getProbability(), NOT_A_PROBABILITY) != NOT_A_PROBABILITY; } childDicNodes->pushLeavingChild(dicNode, nodeReader->getHeadPos(), childDicNodes->pushLeavingChild(dicNode, nodeReader->getHeadPos(), nodeReader->getChildrenPos(), nodeReader->getProbability(), nodeReader->getChildrenPos(), nodeReader->getProbability(), isTerminal, nodeReader->isTerminal() && !nodeReader->isDeleted(), nodeReader->hasChildren(), nodeReader->isBlacklisted() || nodeReader->isNotAWord(), nodeReader->hasChildren(), nodeReader->isBlacklisted() || nodeReader->isNotAWord(), nodeReader->getCodePointCount(), readingHelper.getMergedNodeCodePoints()); nodeReader->getCodePointCount(), readingHelper.getMergedNodeCodePoints()); readingHelper.readNextSiblingNode(); readingHelper.readNextSiblingNode(); Loading Loading
java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java +0 −9 Original line number Original line Diff line number Diff line Loading @@ -113,15 +113,6 @@ public abstract class DecayingExpandableBinaryDictionaryBase extends ExpandableB return false; return false; } } /** * Return whether the passed charsequence is in the dictionary. */ @Override public boolean isValidWord(final String word) { // Words included only in the user history should be treated as not in dictionary words. return false; } /** /** * Pair will be added to the decaying dictionary. * Pair will be added to the decaying dictionary. * * Loading
native/jni/src/suggest/policyimpl/dictionary/dynamic_patricia_trie_policy.cpp +9 −2 Original line number Original line Diff line number Diff line Loading @@ -55,9 +55,16 @@ void DynamicPatriciaTriePolicy::createAndGetAllChildNodes(const DicNode *const d readingHelper.initWithPtNodeArrayPos(dicNode->getChildrenPos()); readingHelper.initWithPtNodeArrayPos(dicNode->getChildrenPos()); const DynamicPatriciaTrieNodeReader *const nodeReader = readingHelper.getNodeReader(); const DynamicPatriciaTrieNodeReader *const nodeReader = readingHelper.getNodeReader(); while (!readingHelper.isEnd()) { while (!readingHelper.isEnd()) { bool isTerminal = nodeReader->isTerminal() && !nodeReader->isDeleted(); if (isTerminal && mHeaderPolicy.isDecayingDict()) { // A DecayingDict may have a terminal PtNode that has a terminal DicNode whose // probability is NOT_A_PROBABILITY. In such case, we don't want to treat it as a // valid terminal DicNode. isTerminal = getProbability(nodeReader->getProbability(), NOT_A_PROBABILITY) != NOT_A_PROBABILITY; } childDicNodes->pushLeavingChild(dicNode, nodeReader->getHeadPos(), childDicNodes->pushLeavingChild(dicNode, nodeReader->getHeadPos(), nodeReader->getChildrenPos(), nodeReader->getProbability(), nodeReader->getChildrenPos(), nodeReader->getProbability(), isTerminal, nodeReader->isTerminal() && !nodeReader->isDeleted(), nodeReader->hasChildren(), nodeReader->isBlacklisted() || nodeReader->isNotAWord(), nodeReader->hasChildren(), nodeReader->isBlacklisted() || nodeReader->isNotAWord(), nodeReader->getCodePointCount(), readingHelper.getMergedNodeCodePoints()); nodeReader->getCodePointCount(), readingHelper.getMergedNodeCodePoints()); readingHelper.readNextSiblingNode(); readingHelper.readNextSiblingNode(); Loading