From b00c054125d9f2aa31c2147920cc52cbf2a45ccc Mon Sep 17 00:00:00 2001 From: Mohammadinamul Sheik Date: Wed, 4 Feb 2015 12:50:31 -0800 Subject: AOSP changes to use KeyboardLayout to support the new DictionaryFacilitator Change-Id: Ie0c9ce805d9ad009fc9bbaac37b715aff90cd844 --- .../latin/spellcheck/AndroidWordLevelSpellCheckerSession.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java') diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java index 832bfd066..0b5e12f03 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java @@ -29,6 +29,7 @@ import android.view.textservice.TextInfo; import com.android.inputmethod.compat.SuggestionsInfoCompatUtils; import com.android.inputmethod.keyboard.Keyboard; +import com.android.inputmethod.keyboard.KeyboardLayout; import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.latin.NgramContext; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; @@ -271,18 +272,21 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session { final int[] codePoints = StringUtils.toCodePointArray(text); final int[] coordinates; final ProximityInfo proximityInfo; + final KeyboardLayout keyboardLayout; if (null == keyboard) { coordinates = CoordinateUtils.newCoordinateArray(codePoints.length, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE); proximityInfo = null; + keyboardLayout = null; } else { coordinates = keyboard.getCoordinates(codePoints); proximityInfo = keyboard.getProximityInfo(); + keyboardLayout = keyboard.getKeyboardLayout(); } composer.setComposingWord(codePoints, coordinates); // TODO: Don't gather suggestions if the limit is <= 0 unless necessary final SuggestionResults suggestionResults = mService.getSuggestionResults( - mLocale, composer, ngramContext, proximityInfo); + mLocale, composer, ngramContext, proximityInfo, keyboardLayout); final Result result = getResult(capitalizeType, mLocale, suggestionsLimit, mService.getRecommendedThreshold(), text, suggestionResults); isInDict = isInDictForAnyCapitalization(text, capitalizeType); -- cgit v1.2.3-83-g751a