aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2009-12-01 11:44:22 -0800
committerAmith Yamasani <yamasani@google.com>2009-12-01 11:44:22 -0800
commitf590a497393eb77875017010e9a36cf33b095e3c (patch)
tree89bc17018c5557fdd2e50bf84406b10cd88d3202 /src
parent6aa7f59292b13a5428afb872dd0fa3a3902c8c61 (diff)
downloadlatinime-f590a497393eb77875017010e9a36cf33b095e3c.tar.gz
latinime-f590a497393eb77875017010e9a36cf33b095e3c.tar.xz
latinime-f590a497393eb77875017010e9a36cf33b095e3c.zip
Fix for 2295810: Auto-correction of English results in Englishman
Comparisons were always happening with lowercase version of the typed word, which wouldn't match the uppercase word in the dictionary, so it became an unrecognized word when typed in full. Highlight was then going to the next word in the list. Fix compares the lowercase and uppercase versions of the word for validity.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/inputmethod/latin/BinaryDictionary.java4
-rw-r--r--src/com/android/inputmethod/latin/LatinIME.java3
2 files changed, 3 insertions, 4 deletions
diff --git a/src/com/android/inputmethod/latin/BinaryDictionary.java b/src/com/android/inputmethod/latin/BinaryDictionary.java
index e7470a8fc..14c543514 100644
--- a/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -36,7 +36,6 @@ public class BinaryDictionary extends Dictionary {
private int mNativeDict;
private int[] mInputCodes = new int[MAX_WORD_LENGTH * MAX_ALTERNATIVES];
- private WordCallback mWordCallback;
private char[] mOutputChars = new char[MAX_WORD_LENGTH * MAX_WORDS];
private int[] mFrequencies = new int[MAX_WORDS];
@@ -75,7 +74,6 @@ public class BinaryDictionary extends Dictionary {
@Override
public void getWords(final WordComposer codes, final WordCallback callback) {
- mWordCallback = callback;
final int codesSize = codes.size();
// Wont deal with really long words.
if (codesSize > MAX_WORD_LENGTH - 1) return;
@@ -123,7 +121,7 @@ public class BinaryDictionary extends Dictionary {
@Override
public boolean isValidWord(CharSequence word) {
if (word == null) return false;
- char[] chars = word.toString().toLowerCase().toCharArray();
+ char[] chars = word.toString().toCharArray();
return isValidWordNative(mNativeDict, chars, chars.length);
}
diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java
index 8b76dbd39..a6cf312d2 100644
--- a/src/com/android/inputmethod/latin/LatinIME.java
+++ b/src/com/android/inputmethod/latin/LatinIME.java
@@ -809,7 +809,8 @@ public class LatinIME extends InputMethodService
//|| mCorrectionMode == mSuggest.CORRECTION_FULL;
CharSequence typedWord = mWord.getTypedWord();
// If we're in basic correct
- boolean typedWordValid = mSuggest.isValidWord(typedWord);
+ boolean typedWordValid = mSuggest.isValidWord(typedWord) ||
+ (preferCapitalization() && mSuggest.isValidWord(typedWord.toString().toLowerCase()));
if (mCorrectionMode == Suggest.CORRECTION_FULL) {
correctionAvailable |= typedWordValid;
}