diff options
author | 2014-06-25 20:20:44 +0900 | |
---|---|---|
committer | 2014-06-25 20:20:44 +0900 | |
commit | 0aef59746c6dd32ea3e3ed0d25b5fbc33e4605d8 (patch) | |
tree | 1c45a154be69c5af84f4f4752d1352b29e7f9902 /java/src | |
parent | 3c07fcbc544cac626dead40e7571233950b49216 (diff) | |
download | latinime-0aef59746c6dd32ea3e3ed0d25b5fbc33e4605d8.tar.gz latinime-0aef59746c6dd32ea3e3ed0d25b5fbc33e4605d8.tar.xz latinime-0aef59746c6dd32ea3e3ed0d25b5fbc33e4605d8.zip |
Make Beginning-of-Sentence prediction require two exposures.
Bug: 15868192
Change-Id: I4b577ad11c992d872d6f902fd50527d9ca5cc1ba
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java b/java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java index 3916fc24c..a6c6c7bac 100644 --- a/java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java +++ b/java/src/com/android/inputmethod/latin/personalization/UserHistoryDictionary.java @@ -75,7 +75,13 @@ public class UserHistoryDictionary extends DecayingExpandableBinaryDictionaryBas return; } if (null != prevWord) { - userHistoryDictionary.addNgramEntry(prevWordsInfo, word, frequency, timestamp); + if (prevWordsInfo.mIsBeginningOfSentence) { + // Beginning-of-Sentence n-gram entry is treated as a n-gram entry of invalid word. + userHistoryDictionary.addNgramEntry(prevWordsInfo, word, + FREQUENCY_FOR_WORDS_NOT_IN_DICTS, timestamp); + } else { + userHistoryDictionary.addNgramEntry(prevWordsInfo, word, frequency, timestamp); + } } } } |