diff options
author | 2014-10-23 07:54:35 +0000 | |
---|---|---|
committer | 2014-10-23 07:54:35 +0000 | |
commit | 77e6afd1f243eb05936a00f54f6839ecacddd35c (patch) | |
tree | bcd93f81f396556ddaa1a765fa92c2011f9bcf99 /java/src/com/android/inputmethod/latin/NgramContext.java | |
parent | 3af7fd0a913d754593c231eb8ba0236b47322f50 (diff) | |
parent | d3a4c5132422b189c8dbb94dbbe84a9b9761b0a8 (diff) | |
download | latinime-77e6afd1f243eb05936a00f54f6839ecacddd35c.tar.gz latinime-77e6afd1f243eb05936a00f54f6839ecacddd35c.tar.xz latinime-77e6afd1f243eb05936a00f54f6839ecacddd35c.zip |
am d3a4c513: Fix Javadoc and null analysis related warnings
* commit 'd3a4c5132422b189c8dbb94dbbe84a9b9761b0a8':
Fix Javadoc and null analysis related warnings
Diffstat (limited to 'java/src/com/android/inputmethod/latin/NgramContext.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/NgramContext.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/NgramContext.java b/java/src/com/android/inputmethod/latin/NgramContext.java index 2dc409f9f..4a3ac0fae 100644 --- a/java/src/com/android/inputmethod/latin/NgramContext.java +++ b/java/src/com/android/inputmethod/latin/NgramContext.java @@ -23,13 +23,17 @@ import com.android.inputmethod.latin.utils.StringUtils; import java.util.Arrays; +import javax.annotation.Nonnull; + /** * Class to represent information of previous words. This class is used to add n-gram entries * into binary dictionaries, to get predictions, and to get suggestions. */ public class NgramContext { + @Nonnull public static final NgramContext EMPTY_PREV_WORDS_INFO = new NgramContext(WordInfo.EMPTY_WORD_INFO); + @Nonnull public static final NgramContext BEGINNING_OF_SENTENCE = new NgramContext(WordInfo.BEGINNING_OF_SENTENCE_WORD_INFO); @@ -37,7 +41,9 @@ public class NgramContext { * Word information used to represent previous words information. */ public static class WordInfo { + @Nonnull public static final WordInfo EMPTY_WORD_INFO = new WordInfo(null); + @Nonnull public static final WordInfo BEGINNING_OF_SENTENCE_WORD_INFO = new WordInfo(); // This is an empty char sequence when mIsBeginningOfSentence is true. @@ -97,6 +103,7 @@ public class NgramContext { } // Create next prevWordsInfo using current prevWordsInfo. + @Nonnull public NgramContext getNextNgramContext(final WordInfo wordInfo) { final int nextPrevWordCount = Math.min(Constants.MAX_PREV_WORD_COUNT_FOR_N_GRAM, mPrevWordsCount + 1); |