aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-12-13 12:37:23 +0900
committerTadashi G. Takaoka <takaoka@google.com>2010-12-13 14:40:49 +0900
commit9ecad8c2e8571ece6f3f7fbb19ceda5be7866cf0 (patch)
tree324cf0f3aa692c97370324d955b22d720a349605 /java/src/com/android/inputmethod/latin/LatinIME.java
parent4ca16dbd65150359c3884da7cb59a30f19abd4b7 (diff)
downloadlatinime-9ecad8c2e8571ece6f3f7fbb19ceda5be7866cf0.tar.gz
latinime-9ecad8c2e8571ece6f3f7fbb19ceda5be7866cf0.tar.xz
latinime-9ecad8c2e8571ece6f3f7fbb19ceda5be7866cf0.zip
Fix auto correction threshold values array reference
This change also removes unused argument from Suggest.getSuggestions(). Change-Id: I512f8695d22898bb906e136a66e0ee6b521cd1d1
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 010473f05..5a1232064 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1438,8 +1438,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (mCandidateView != null) {
mCandidateView.setSuggestions(words);
- if (mCandidateView.isConfigCandidateHighlightFontColorEnabled())
- mKeyboardSwitcher.onAutoCorrectionStateChanged(words.hasAutoCorrectionWord());
+ if (mCandidateView.isConfigCandidateHighlightFontColorEnabled()) {
+ mKeyboardSwitcher.onAutoCorrectionStateChanged(
+ words.hasWordAboveAutoCorrectionScoreThreshold());
+ }
}
}
@@ -1460,8 +1462,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
private SuggestedWords.Builder getTypedSuggestions(WordComposer word) {
- return mSuggest.getSuggestedWordBuilder(
- mKeyboardSwitcher.getInputView(), word, false, null);
+ return mSuggest.getSuggestedWordBuilder(mKeyboardSwitcher.getInputView(), word, null);
}
private void showCorrections(WordAlternatives alternatives) {
@@ -1477,9 +1478,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
CharSequence prevWord = EditingUtils.getPreviousWord(getCurrentInputConnection(),
mWordSeparators);
SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(
- mKeyboardSwitcher.getInputView(), word, false, prevWord);
- // long stopTime = System.currentTimeMillis(); // TIME MEASUREMENT!
- // Log.d("LatinIME","Suggest Total Time - " + (stopTime - startTime));
+ mKeyboardSwitcher.getInputView(), word, prevWord);
int[] nextLettersFrequencies = mSuggest.getNextLettersFrequencies();
mKeyboardSwitcher.setPreferredLetters(nextLettersFrequencies);
@@ -1506,8 +1505,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void showSuggestions(SuggestedWords suggestedWords, CharSequence typedWord) {
setSuggestions(suggestedWords);
if (suggestedWords.size() > 0) {
- if (suggestedWords.mHasMinimalSuggestion
- && !suggestedWords.mTypedWordValid && suggestedWords.size() > 1) {
+ if (suggestedWords.hasAutoCorrectionWord()) {
mBestWord = suggestedWords.getWord(1);
} else {
mBestWord = typedWord;
@@ -2067,9 +2065,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final String currentAutoCorrectionSetting = sp.getString(
Settings.PREF_AUTO_CORRECTION_THRESHOLD,
- mResources.getString(R.string.auto_correction_threshold_mode_value_modest));
+ mResources.getString(R.string.auto_correction_threshold_mode_index_modest));
final String[] autoCorrectionThresholdValues = mResources.getStringArray(
- R.array.auto_correction_threshold_mode_values);
+ R.array.auto_correction_threshold_values);
// When autoCrrectionThreshold is greater than 1.0, auto correction is virtually turned off.
double autoCorrectionThreshold = Double.MAX_VALUE;
try {
@@ -2094,9 +2092,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private boolean isAutoCorrectEnabled(SharedPreferences sp) {
final String currentAutoCorrectionSetting = sp.getString(
Settings.PREF_AUTO_CORRECTION_THRESHOLD,
- mResources.getString(R.string.auto_correction_threshold_mode_value_modest));
+ mResources.getString(R.string.auto_correction_threshold_mode_index_modest));
final String autoCorrectionOff = mResources.getString(
- R.string.auto_correction_threshold_mode_value_off);
+ R.string.auto_correction_threshold_mode_index_off);
return !currentAutoCorrectionSetting.equals(autoCorrectionOff);
}