am bb6f9146: DO NOT MERGE: Fix for 2295810: Auto-correction of English results in Englishman

Merge commit 'bb6f9146f1de4e0bdfaafca1d1896e02d038751d' into eclair-plus-aosp

* commit 'bb6f9146f1de4e0bdfaafca1d1896e02d038751d':
  DO NOT MERGE: Fix for 2295810: Auto-correction of English results in Englishman
This commit is contained in:
Amith Yamasani 2009-12-03 05:41:29 -08:00 committed by Android Git Automerger
commit 929dc479b0
2 changed files with 3 additions and 4 deletions

View file

@ -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);
}

View file

@ -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;
}