aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-10-07 15:48:04 +0900
committerJean Chalard <jchalard@google.com>2013-10-07 17:27:27 +0900
commitdf33982fce6312203ed7446926f31ed92a8ae1ca (patch)
treed5280ab20cce8507e98cfcd10709e1fb69befa3d /java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
parenta8f4efd0132592c34ab87b6a3cf6ce1baa0f522d (diff)
downloadlatinime-df33982fce6312203ed7446926f31ed92a8ae1ca.tar.gz
latinime-df33982fce6312203ed7446926f31ed92a8ae1ca.tar.xz
latinime-df33982fce6312203ed7446926f31ed92a8ae1ca.zip
Remove suggestions when string contains a period
This is not the right way to do it, but it's simple and will kill the regression. We should investigate why the return values are wrong in this case. Bug: 10780091 Change-Id: I808727242c9cb1598df00a7426358dc3a658add4
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java')
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
index eb6d7c106..503b18b1b 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
@@ -204,10 +204,20 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
return AndroidSpellCheckerSessionFactory.newInstance(this);
}
- public static SuggestionsInfo getNotInDictEmptySuggestions() {
- return new SuggestionsInfo(0, EMPTY_STRING_ARRAY);
+ /**
+ * Returns an empty SuggestionsInfo with flags signaling the word is not in the dictionary.
+ * @param reportAsTypo whether this should include the flag LOOKS_LIKE_TYPO, for red underline.
+ * @return the empty SuggestionsInfo with the appropriate flags set.
+ */
+ public static SuggestionsInfo getNotInDictEmptySuggestions(final boolean reportAsTypo) {
+ return new SuggestionsInfo(reportAsTypo ? SuggestionsInfo.RESULT_ATTR_LOOKS_LIKE_TYPO : 0,
+ EMPTY_STRING_ARRAY);
}
+ /**
+ * Returns an empty suggestionInfo with flags signaling the word is in the dictionary.
+ * @return the empty SuggestionsInfo with the appropriate flags set.
+ */
public static SuggestionsInfo getInDictEmptySuggestions() {
return new SuggestionsInfo(SuggestionsInfo.RESULT_ATTR_IN_THE_DICTIONARY,
EMPTY_STRING_ARRAY);