diff options
author | 2011-08-04 02:46:13 -0700 | |
---|---|---|
committer | 2011-08-04 02:46:13 -0700 | |
commit | 2e2906bc1793c0389d9d921bded04fb1de252ab6 (patch) | |
tree | 7f70a3dbfc301e166386ee86cb55f0aab220921b /native/src | |
parent | 80ba224fffdb64f7ef97bca1723f46e8d4fae2dd (diff) | |
parent | f071e75b781ebb9e1b8dd5b3111af9a92de66bc1 (diff) | |
download | latinime-2e2906bc1793c0389d9d921bded04fb1de252ab6.tar.gz latinime-2e2906bc1793c0389d9d921bded04fb1de252ab6.tar.xz latinime-2e2906bc1793c0389d9d921bded04fb1de252ab6.zip |
Merge "Change the prune condition"
Diffstat (limited to 'native/src')
-rw-r--r-- | native/src/unigram_dictionary.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp index 9f8f04e50..b95da99a3 100644 --- a/native/src/unigram_dictionary.cpp +++ b/native/src/unigram_dictionary.cpp @@ -808,7 +808,8 @@ inline bool UnigramDictionary::processCurrentNode(const int initialPos, const in } } // Optimization: Prune out words that are too long compared to how much was typed. - if (correctionState->getOutputIndex() >= maxDepth || diffs > mMaxEditDistance) { + if (isTerminal + && (correctionState->getOutputIndex() >= maxDepth || diffs > mMaxEditDistance)) { // We are giving up parsing this node and its children. Skip the rest of the node, // output the sibling position, and return that we don't want to traverse children. if (!isLastChar) { |