aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-06-27 12:50:18 +0900
committerJean Chalard <jchalard@google.com>2014-06-27 12:52:23 +0900
commite530fffc2c3655ba588454503cbaa7eacba4bffe (patch)
tree736f24f4966b0f7e47e8a7134e96d116926c0736 /java/src
parentc152d7c19d4a9e84acaf6fffa4f51c583f191f6f (diff)
downloadlatinime-e530fffc2c3655ba588454503cbaa7eacba4bffe.tar.gz
latinime-e530fffc2c3655ba588454503cbaa7eacba4bffe.tar.xz
latinime-e530fffc2c3655ba588454503cbaa7eacba4bffe.zip
Add a relevant suggestion to period-checkable requests
Bug: 15412461 Change-Id: Ibf37df4d31141a7e43b54d6342e7861eedb1c03b
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Constants.java1
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputConnection.java5
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java4
3 files changed, 6 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/Constants.java b/java/src/com/android/inputmethod/latin/Constants.java
index b4e115c7d..43af66eb7 100644
--- a/java/src/com/android/inputmethod/latin/Constants.java
+++ b/java/src/com/android/inputmethod/latin/Constants.java
@@ -220,6 +220,7 @@ public final class Constants {
public static final String REGEXP_PERIOD = "\\.";
public static final String STRING_SPACE = " ";
+ public static final String STRING_PERIOD_AND_SPACE = ". ";
/**
* Special keys code. Must be negative.
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java
index 3be6bccc6..c027892ba 100644
--- a/java/src/com/android/inputmethod/latin/RichInputConnection.java
+++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java
@@ -741,13 +741,12 @@ public final class RichInputConnection {
// Here we test whether we indeed have a period and a space before us. This should not
// be needed, but it's there just in case something went wrong.
final CharSequence textBeforeCursor = getTextBeforeCursor(2, 0);
- final String periodSpace = ". ";
- if (!TextUtils.equals(periodSpace, textBeforeCursor)) {
+ if (!TextUtils.equals(Constants.STRING_PERIOD_AND_SPACE, textBeforeCursor)) {
// Theoretically we should not be coming here if there isn't ". " before the
// cursor, but the application may be changing the text while we are typing, so
// anything goes. We should not crash.
Log.d(TAG, "Tried to revert double-space combo but we didn't find "
- + "\"" + periodSpace + "\" just before the cursor.");
+ + "\"" + Constants.STRING_PERIOD_AND_SPACE + "\" just before the cursor.");
return false;
}
// Double-space results in ". ". A backspace to cancel this should result in a single
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
index db15c1cc6..be33f339d 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
@@ -258,7 +258,9 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session {
return new SuggestionsInfo(SuggestionsInfo.RESULT_ATTR_LOOKS_LIKE_TYPO
| SuggestionsInfo.RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS,
new String[] {
- TextUtils.join(Constants.STRING_SPACE, splitText) });
+ TextUtils.join(Constants.STRING_SPACE, splitText),
+ TextUtils.join(Constants.STRING_PERIOD_AND_SPACE,
+ splitText) });
}
}
return dictInfo.mDictionary.isValidWord(inText)