am 1c5f5eca
: am 47568d5e
: Merge "Fix: Suggested words from user history are invalid. DO NOT MERGE." into klp-dev
* commit '1c5f5eca9d6b26fd599523acb203dc4aa846bc89': Fix: Suggested words from user history are invalid. DO NOT MERGE.
This commit is contained in:
commit
f099c7e3d3
2 changed files with 9 additions and 11 deletions
|
@ -113,15 +113,6 @@ public abstract class DecayingExpandableBinaryDictionaryBase extends ExpandableB
|
|||
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.
|
||||
*
|
||||
|
|
|
@ -55,9 +55,16 @@ void DynamicPatriciaTriePolicy::createAndGetAllChildNodes(const DicNode *const d
|
|||
readingHelper.initWithPtNodeArrayPos(dicNode->getChildrenPos());
|
||||
const DynamicPatriciaTrieNodeReader *const nodeReader = readingHelper.getNodeReader();
|
||||
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(),
|
||||
nodeReader->getChildrenPos(), nodeReader->getProbability(),
|
||||
nodeReader->isTerminal() && !nodeReader->isDeleted(),
|
||||
nodeReader->getChildrenPos(), nodeReader->getProbability(), isTerminal,
|
||||
nodeReader->hasChildren(), nodeReader->isBlacklisted() || nodeReader->isNotAWord(),
|
||||
nodeReader->getCodePointCount(), readingHelper.getMergedNodeCodePoints());
|
||||
readingHelper.readNextSiblingNode();
|
||||
|
|
Loading…
Reference in a new issue