aboutsummaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-10-06 10:38:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-06 10:38:18 +0000
commitc7d199e770e6b2d79b9558a1a5d98e6e71b7ac09 (patch)
treea309e7bed5168118a309483f060f72686c48e050 /native
parent70d10976c6fa8e8b2072b6f08850e57b844300e4 (diff)
parentca17ed7d9dcafd15d79da04f8c0ba6cdf6f0dde4 (diff)
downloadlatinime-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.cpp5
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;