diff options
author | 2015-03-10 15:04:11 +0000 | |
---|---|---|
committer | 2015-03-10 15:04:11 +0000 | |
commit | bc6b315c2b9303cd37cf4fbc2112b08a02ba98c6 (patch) | |
tree | ff77a572aceacbf4b67dc3d067b61f50ed8b90c7 /java/src | |
parent | 13b43c1c7dc8290526ef4f08aeb51d41463b08d1 (diff) | |
parent | 21a28abc6ac3a2404e7b90327122b1364a283ec9 (diff) | |
download | latinime-bc6b315c2b9303cd37cf4fbc2112b08a02ba98c6.tar.gz latinime-bc6b315c2b9303cd37cf4fbc2112b08a02ba98c6.tar.xz latinime-bc6b315c2b9303cd37cf4fbc2112b08a02ba98c6.zip |
am 21a28abc: Handle empty previous ngram context correctly.
* commit '21a28abc6ac3a2404e7b90327122b1364a283ec9':
Handle empty previous ngram context correctly.
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/NgramContext.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/NgramContext.java b/java/src/com/android/inputmethod/latin/NgramContext.java index c9351586e..aeeff6126 100644 --- a/java/src/com/android/inputmethod/latin/NgramContext.java +++ b/java/src/com/android/inputmethod/latin/NgramContext.java @@ -142,8 +142,7 @@ public class NgramContext { } } } - return terms.size() == 0 ? BEGINNING_OF_SENTENCE_TAG - : TextUtils.join(CONTEXT_SEPARATOR, terms); + return TextUtils.join(CONTEXT_SEPARATOR, terms); } /** @@ -166,9 +165,7 @@ public class NgramContext { } } } - final String[] contextStringArray = prevTermList.size() == 0 ? - new String[] { BEGINNING_OF_SENTENCE_TAG } - : prevTermList.toArray(new String[prevTermList.size()]); + final String[] contextStringArray = prevTermList.toArray(new String[prevTermList.size()]); return contextStringArray; } |