am f590a497: Fix for 2295810: Auto-correction of English results in Englishman

Merge commit 'f590a497393eb77875017010e9a36cf33b095e3c' into eclair-mr2-plus-aosp

* commit 'f590a497393eb77875017010e9a36cf33b095e3c':
  Fix for 2295810: Auto-correction of English results in Englishman
main
Amith Yamasani 2009-12-01 17:25:05 -08:00 committed by Android Git Automerger
commit 52a7a41582
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 mNativeDict;
private int[] mInputCodes = new int[MAX_WORD_LENGTH * MAX_ALTERNATIVES]; private int[] mInputCodes = new int[MAX_WORD_LENGTH * MAX_ALTERNATIVES];
private WordCallback mWordCallback;
private char[] mOutputChars = new char[MAX_WORD_LENGTH * MAX_WORDS]; private char[] mOutputChars = new char[MAX_WORD_LENGTH * MAX_WORDS];
private int[] mFrequencies = new int[MAX_WORDS]; private int[] mFrequencies = new int[MAX_WORDS];
@ -75,7 +74,6 @@ public class BinaryDictionary extends Dictionary {
@Override @Override
public void getWords(final WordComposer codes, final WordCallback callback) { public void getWords(final WordComposer codes, final WordCallback callback) {
mWordCallback = callback;
final int codesSize = codes.size(); final int codesSize = codes.size();
// Wont deal with really long words. // Wont deal with really long words.
if (codesSize > MAX_WORD_LENGTH - 1) return; if (codesSize > MAX_WORD_LENGTH - 1) return;
@ -123,7 +121,7 @@ public class BinaryDictionary extends Dictionary {
@Override @Override
public boolean isValidWord(CharSequence word) { public boolean isValidWord(CharSequence word) {
if (word == null) return false; if (word == null) return false;
char[] chars = word.toString().toLowerCase().toCharArray(); char[] chars = word.toString().toCharArray();
return isValidWordNative(mNativeDict, chars, chars.length); return isValidWordNative(mNativeDict, chars, chars.length);
} }

View File

@ -809,7 +809,8 @@ public class LatinIME extends InputMethodService
//|| mCorrectionMode == mSuggest.CORRECTION_FULL; //|| mCorrectionMode == mSuggest.CORRECTION_FULL;
CharSequence typedWord = mWord.getTypedWord(); CharSequence typedWord = mWord.getTypedWord();
// If we're in basic correct // 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) { if (mCorrectionMode == Suggest.CORRECTION_FULL) {
correctionAvailable |= typedWordValid; correctionAvailable |= typedWordValid;
} }