diff options
author | 2014-10-06 10:38:17 +0000 | |
---|---|---|
committer | 2014-10-06 10:38:18 +0000 | |
commit | c7d199e770e6b2d79b9558a1a5d98e6e71b7ac09 (patch) | |
tree | a309e7bed5168118a309483f060f72686c48e050 /native | |
parent | 70d10976c6fa8e8b2072b6f08850e57b844300e4 (diff) | |
parent | ca17ed7d9dcafd15d79da04f8c0ba6cdf6f0dde4 (diff) | |
download | latinime-c7d199e770e6b2d79b9558a1a5d98e6e71b7ac09.tar.gz latinime-c7d199e770e6b2d79b9558a1a5d98e6e71b7ac09.tar.xz latinime-c7d199e770e6b2d79b9558a1a5d98e6e71b7ac09.zip |
Merge "Fix: BoS prediction is shown after inputting just once."
Diffstat (limited to 'native')
-rw-r--r-- | native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp b/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp index 11f7b305f..cb07cbdad 100644 --- a/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp +++ b/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp @@ -428,7 +428,10 @@ bool Ver4PatriciaTriePolicy::updateCounter(const PrevWordsInfo *const prevWordsI AKLOGE("Cannot update unigarm entry in updateCounter()."); return false; } - const NgramProperty ngramProperty(wordCodePoints.toVector(), probability, historicalInfo); + const int probabilityForNgram = prevWordsInfo->isNthPrevWordBeginningOfSentence(1 /* n */) + ? NOT_A_PROBABILITY : probability; + const NgramProperty ngramProperty(wordCodePoints.toVector(), probabilityForNgram, + historicalInfo); if (!addNgramEntry(prevWordsInfo, &ngramProperty)) { AKLOGE("Cannot update unigarm entry in updateCounter()."); return false; |