diff options
author | 2014-05-23 11:01:04 +0000 | |
---|---|---|
committer | 2014-05-23 11:01:04 +0000 | |
commit | 662c22759b7be19e6871f0e63c3d2f0bad68646e (patch) | |
tree | 97d93b91f5f4d9d4b944456f6af1911e92ef075b /java/src/com/android/inputmethod/latin/PrevWordsInfo.java | |
parent | 287bfae89f6dfc4e4e77a2adf52d1900104a945c (diff) | |
parent | 1adca93381d261a6070be2721dbf8b8abafbfe01 (diff) | |
download | latinime-662c22759b7be19e6871f0e63c3d2f0bad68646e.tar.gz latinime-662c22759b7be19e6871f0e63c3d2f0bad68646e.tar.xz latinime-662c22759b7be19e6871f0e63c3d2f0bad68646e.zip |
Merge "Extend jni methods and enable Beginning-of-Sentence."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/PrevWordsInfo.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/PrevWordsInfo.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/PrevWordsInfo.java b/java/src/com/android/inputmethod/latin/PrevWordsInfo.java index ecc8947db..3494d16f7 100644 --- a/java/src/com/android/inputmethod/latin/PrevWordsInfo.java +++ b/java/src/com/android/inputmethod/latin/PrevWordsInfo.java @@ -20,6 +20,8 @@ import android.util.Log; // TODO: Support multiple previous words for n-gram. public class PrevWordsInfo { + public static final PrevWordsInfo BEGINNING_OF_SENTENCE = new PrevWordsInfo(); + // The previous word. May be null after resetting and before starting a new composing word, or // when there is no context like at the start of text for example. It can also be set to null // externally when the user enters a separator that does not let bigrams across, like a period @@ -32,7 +34,7 @@ public class PrevWordsInfo { // Beginning of sentence. public PrevWordsInfo() { - mPrevWord = null; + mPrevWord = ""; mIsBeginningOfSentence = true; } @@ -40,4 +42,8 @@ public class PrevWordsInfo { mPrevWord = prevWord; mIsBeginningOfSentence = false; } + + public boolean isValid() { + return mPrevWord != null; + } } |