Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6845427e authored by Satoshi Kataoka's avatar Satoshi Kataoka
Browse files

DO NOT MERGE: Return possible suggestions in Google Spell Checker

Bug: 8772531

By the change in the suggestion algorithm, the pruning of the suggestions is not required anymore. This has been fixed in master branch properly.

Change-Id: I6ab9da953d69ff726d2bc328c09064e6ade0dcea
parent 25c90e6d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -141,7 +141,6 @@ public final class BinaryDictionary extends Dictionary {
                mOutputTypes);
        final ArrayList<SuggestedWordInfo> suggestions = CollectionUtils.newArrayList();
        for (int j = 0; j < count; ++j) {
            if (composerSize > 0 && mOutputScores[j] < 1) break;
            final int start = j * MAX_WORD_LENGTH;
            int len = 0;
            while (len < MAX_WORD_LENGTH && mOutputCodePoints[start + len] != 0) {
+0 −9
Original line number Diff line number Diff line
@@ -267,16 +267,7 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
                return true;
            }

            // Compute the normalized score and skip this word if it's normalized score does not
            // make the threshold.
            final String wordString = new String(word, wordOffset, wordLength);
            final float normalizedScore =
                    BinaryDictionary.calcNormalizedScore(mOriginalText, wordString, score);
            if (normalizedScore < mSuggestionThreshold) {
                if (DBG) Log.i(TAG, wordString + " does not make the score threshold");
                return true;
            }

            if (mLength < mMaxLength) {
                final int copyLen = mLength - insertIndex;
                ++mLength;