diff options
author | 2012-03-09 14:52:20 +0900 | |
---|---|---|
committer | 2012-03-09 14:52:35 +0900 | |
commit | cf8bc92ba0946248a080731fea862b0ff997cafb (patch) | |
tree | 358e6496e71ec6a7d2f64b182f3c488446d017e9 /java/src | |
parent | 92146f29269a799935c00c530d05829d7f17cc9e (diff) | |
download | latinime-cf8bc92ba0946248a080731fea862b0ff997cafb.tar.gz latinime-cf8bc92ba0946248a080731fea862b0ff997cafb.tar.xz latinime-cf8bc92ba0946248a080731fea862b0ff997cafb.zip |
Rename a parameter (B6)
This is not necessarily the typed word. Actually, the parameter
that's passed here has trailing single quotes culled out of it.
Change-Id: Ia2038faa2cbbd3a5b8263e6c0fb5b8e670993fe9
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/AutoCorrection.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/latin/AutoCorrection.java b/java/src/com/android/inputmethod/latin/AutoCorrection.java index 851e287e5..e9ed90e7b 100644 --- a/java/src/com/android/inputmethod/latin/AutoCorrection.java +++ b/java/src/com/android/inputmethod/latin/AutoCorrection.java @@ -32,15 +32,15 @@ public class AutoCorrection { public static CharSequence computeAutoCorrectionWord(Map<String, Dictionary> dictionaries, WordComposer wordComposer, ArrayList<CharSequence> suggestions, int[] sortedScores, - CharSequence typedWord, double autoCorrectionThreshold, + CharSequence consideredWord, double autoCorrectionThreshold, CharSequence whitelistedWord) { if (hasAutoCorrectionForWhitelistedWord(whitelistedWord)) { return whitelistedWord; - } else if (hasAutoCorrectionForTypedWord( - dictionaries, wordComposer, suggestions, typedWord)) { - return typedWord; + } else if (hasAutoCorrectionForConsideredWord( + dictionaries, wordComposer, suggestions, consideredWord)) { + return consideredWord; } else if (hasAutoCorrectionForBinaryDictionary(wordComposer, suggestions, - sortedScores, typedWord, autoCorrectionThreshold)) { + sortedScores, consideredWord, autoCorrectionThreshold)) { return suggestions.get(0); } return null; @@ -87,28 +87,28 @@ public class AutoCorrection { return whiteListedWord != null; } - private static boolean hasAutoCorrectionForTypedWord(Map<String, Dictionary> dictionaries, + private static boolean hasAutoCorrectionForConsideredWord(Map<String, Dictionary> dictionaries, WordComposer wordComposer, ArrayList<CharSequence> suggestions, - CharSequence typedWord) { - if (TextUtils.isEmpty(typedWord)) return false; + CharSequence consideredWord) { + if (TextUtils.isEmpty(consideredWord)) return false; return wordComposer.size() > 1 && suggestions.size() > 0 - && !allowsToBeAutoCorrected(dictionaries, typedWord, false); + && !allowsToBeAutoCorrected(dictionaries, consideredWord, false); } private static boolean hasAutoCorrectionForBinaryDictionary(WordComposer wordComposer, ArrayList<CharSequence> suggestions, int[] sortedScores, - CharSequence typedWord, double autoCorrectionThreshold) { + CharSequence consideredWord, double autoCorrectionThreshold) { if (wordComposer.size() > 1 - && typedWord != null && suggestions.size() > 0 && sortedScores.length > 0) { + && consideredWord != null && suggestions.size() > 0 && sortedScores.length > 0) { final CharSequence autoCorrectionSuggestion = suggestions.get(0); final int autoCorrectionSuggestionScore = sortedScores[0]; // TODO: when the normalized score of the first suggestion is nearly equals to // the normalized score of the second suggestion, behave less aggressive. final double normalizedScore = BinaryDictionary.calcNormalizedScore( - typedWord.toString(), autoCorrectionSuggestion.toString(), + consideredWord.toString(), autoCorrectionSuggestion.toString(), autoCorrectionSuggestionScore); if (DBG) { - Log.d(TAG, "Normalized " + typedWord + "," + autoCorrectionSuggestion + "," + Log.d(TAG, "Normalized " + consideredWord + "," + autoCorrectionSuggestion + "," + autoCorrectionSuggestionScore + ", " + normalizedScore + "(" + autoCorrectionThreshold + ")"); } |