aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java10
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestionsView.java2
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java20
3 files changed, 21 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 68d93295c..08af5c5e3 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1004,15 +1004,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
return false;
}
- final Resources res = mResources;
- final DisplayMetrics dm = res.getDisplayMetrics();
- // If the display is more than X DIP high, don't go to fullscreen mode
- final int threshold = res.getDimensionPixelSize(R.dimen.max_height_for_fullscreen);
- if (dm.heightPixels >= threshold) {
- return false;
- } else {
- return super.onEvaluateFullscreenMode();
- }
+ return mResources.getBoolean(R.bool.config_use_fullscreen_mode);
}
@Override
diff --git a/java/src/com/android/inputmethod/latin/SuggestionsView.java b/java/src/com/android/inputmethod/latin/SuggestionsView.java
index 22aa5e259..6879f7660 100644
--- a/java/src/com/android/inputmethod/latin/SuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/SuggestionsView.java
@@ -146,7 +146,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
private static final int DEFAULT_SUGGESTIONS_COUNT_IN_STRIP = 3;
private static final int DEFAULT_CENTER_SUGGESTION_PERCENTILE = 40;
private static final int DEFAULT_MAX_MORE_SUGGESTIONS_ROW = 2;
- private static final int PUNCTUATIONS_IN_STRIP = 6;
+ private static final int PUNCTUATIONS_IN_STRIP = 5;
public final int mPadding;
public final int mDividerWidth;
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
index 85c142f1e..ae47ab22b 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
@@ -160,6 +160,9 @@ public class AndroidSpellCheckerService extends SpellCheckerService {
if (mLength != mSuggestions.size()) {
Log.e(TAG, "Suggestion size is not the same as stored mLength");
}
+ for (int i = mLength - 1; i >= 0; --i) {
+ Log.i(TAG, "" + mScores[i] + " " + mSuggestions.get(i));
+ }
}
Collections.reverse(mSuggestions);
Utils.removeDupes(mSuggestions);
@@ -167,11 +170,16 @@ public class AndroidSpellCheckerService extends SpellCheckerService {
// into a String[].
gatheredSuggestions = mSuggestions.toArray(EMPTY_STRING_ARRAY);
- final int bestScore = mScores[0];
+ final int bestScore = mScores[mLength - 1];
final CharSequence bestSuggestion = mSuggestions.get(0);
final double normalizedScore =
Utils.calcNormalizedScore(originalText, bestSuggestion, bestScore);
looksLikeTypo = (normalizedScore > threshold);
+ if (DBG) {
+ Log.i(TAG, "Best suggestion : " + bestSuggestion + ", score " + bestScore);
+ Log.i(TAG, "Normalized score = " + normalizedScore + " (threshold " + threshold
+ + ") => looksLikeTypo = " + looksLikeTypo);
+ }
}
return new Result(gatheredSuggestions, looksLikeTypo);
}
@@ -305,6 +313,16 @@ public class AndroidSpellCheckerService extends SpellCheckerService {
final SuggestionsGatherer.Result result =
suggestionsGatherer.getResults(text, mService.mTypoThreshold);
+ if (DBG) {
+ Log.i(TAG, "Spell checking results for " + text + " with suggestion limit "
+ + suggestionsLimit);
+ Log.i(TAG, "IsInDict = " + result.mLooksLikeTypo);
+ Log.i(TAG, "LooksLikeTypo = " + result.mLooksLikeTypo);
+ for (String suggestion : result.mSuggestions) {
+ Log.i(TAG, suggestion);
+ }
+ }
+
final int flags =
(isInDict ? SuggestionsInfo.RESULT_ATTR_IN_THE_DICTIONARY : 0)
| (result.mLooksLikeTypo