Use localized toLowerString in AutoCorrection.isValidWord
Bug: 9112465 Change-Id: I63eb4115f393444560e80220d4c90f0f7101b934main
parent
ebe0544fc8
commit
618407ab7e
|
@ -32,12 +32,13 @@ public final class AutoCorrection {
|
|||
// Purely static class: can't instantiate.
|
||||
}
|
||||
|
||||
public static boolean isValidWord(final ConcurrentHashMap<String, Dictionary> dictionaries,
|
||||
final String word, final boolean ignoreCase) {
|
||||
public static boolean isValidWord(final Suggest suggest, final String word,
|
||||
final boolean ignoreCase) {
|
||||
if (TextUtils.isEmpty(word)) {
|
||||
return false;
|
||||
}
|
||||
final String lowerCasedWord = word.toLowerCase();
|
||||
final ConcurrentHashMap<String, Dictionary> dictionaries = suggest.getUnigramDictionaries();
|
||||
final String lowerCasedWord = word.toLowerCase(suggest.mLocale);
|
||||
for (final String key : dictionaries.keySet()) {
|
||||
final Dictionary dictionary = dictionaries.get(key);
|
||||
// It's unclear how realistically 'dictionary' can be null, but the monkey is somehow
|
||||
|
|
|
@ -2371,7 +2371,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||
final boolean showingAddToDictionaryHint =
|
||||
SuggestedWordInfo.KIND_TYPED == suggestionInfo.mKind && mSuggest != null
|
||||
// If the suggestion is not in the dictionary, the hint should be shown.
|
||||
&& !AutoCorrection.isValidWord(mSuggest.getUnigramDictionaries(), suggestion, true);
|
||||
&& !AutoCorrection.isValidWord(mSuggest, suggestion, true);
|
||||
|
||||
if (mSettings.isInternal()) {
|
||||
Stats.onSeparator((char)Constants.CODE_SPACE,
|
||||
|
|
|
@ -229,7 +229,7 @@ public final class Suggest {
|
|||
// or if it's a 2+ characters non-word (i.e. it's not in the dictionary).
|
||||
final boolean allowsToBeAutoCorrected = (null != whitelistedWord
|
||||
&& !whitelistedWord.equals(consideredWord))
|
||||
|| (consideredWord.length() > 1 && !AutoCorrection.isValidWord(mDictionaries,
|
||||
|| (consideredWord.length() > 1 && !AutoCorrection.isValidWord(this,
|
||||
consideredWord, wordComposer.isFirstCharCapitalized()));
|
||||
|
||||
final boolean hasAutoCorrection;
|
||||
|
|
Loading…
Reference in New Issue