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

Commit b5db2709 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Remove unused private method Suggest.searchBigramSuggestion

Change-Id: I077c4c019676fefb8eac6042bd7db1b7ab33ca03
parent 24ce3645
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -503,27 +503,6 @@ public class Suggest implements Dictionary.WordCallback {
        return true;
    }

    // TODO: Use codepoint instead of char
    private int searchBigramSuggestion(final char[] word, final int offset, final int length) {
        // TODO This is almost O(n^2). Might need fix.
        // search whether the word appeared in bigram data
        int bigramSuggestSize = mBigramSuggestions.size();
        for (int i = 0; i < bigramSuggestSize; i++) {
            if (mBigramSuggestions.get(i).codePointCount() == length) {
                boolean chk = true;
                for (int j = 0; j < length; j++) {
                    if (mBigramSuggestions.get(i).codePointAt(j) != word[offset+j]) {
                        chk = false;
                        break;
                    }
                }
                if (chk) return i;
            }
        }

        return -1;
    }

    public void close() {
        final HashSet<Dictionary> dictionaries = new HashSet<Dictionary>();
        dictionaries.addAll(mUnigramDictionaries.values());