aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorChieu Nguyen <cvnguyen@google.com>2015-01-27 21:46:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-27 21:46:51 +0000
commita8278c94744939b578ae4f1a749794cb2babd71d (patch)
treef62dea2a3c4b12ee2b5b30b492aa63f8ba95d03f /java/src
parent4366e6c0b175235db6d7e19d5dc730886c3d779c (diff)
parentd523bacebc2498186d6d01140d3fde1eca11c80f (diff)
downloadlatinime-a8278c94744939b578ae4f1a749794cb2babd71d.tar.gz
latinime-a8278c94744939b578ae4f1a749794cb2babd71d.tar.xz
latinime-a8278c94744939b578ae4f1a749794cb2babd71d.zip
am d523bace: Merge "Add a method for handling for words not found in dictionary."
* commit 'd523bacebc2498186d6d01140d3fde1eca11c80f': Add a method for handling for words not found in dictionary.
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
index 4b8d2a3f9..832bfd066 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
@@ -39,6 +39,7 @@ import com.android.inputmethod.latin.common.LocaleUtils;
import com.android.inputmethod.latin.common.StringUtils;
import com.android.inputmethod.latin.utils.BinaryDictionaryUtils;
import com.android.inputmethod.latin.utils.ScriptUtils;
+import com.android.inputmethod.latin.utils.StatsUtils;
import com.android.inputmethod.latin.utils.SuggestionResults;
import java.util.ArrayList;
@@ -297,6 +298,15 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session {
}
}
}
+ // Handle word not in dictionary.
+ // This is called only once per unique word, so entering multiple
+ // instances of the same word does not result in more than one call
+ // to this method.
+ // Also, upon changing the orientation of the device, this is called
+ // again for every unique invalid word in the text box.
+ if (!isInDict) {
+ StatsUtils.onInvalidWordIdentification(text);
+ }
final int flags =
(isInDict ? SuggestionsInfo.RESULT_ATTR_IN_THE_DICTIONARY