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

Commit 3b57631b authored by Jean Chalard's avatar Jean Chalard
Browse files

Resolve a TODO: bury some implementation detail in native (A110)

The fact that prediction does not accept a null argument is an
implementation detail, it should not be visible to Java code.

Change-Id: I3a156b323b6db9353de898d33f3f7c81751cecb1
parent 18d76afa
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -122,8 +122,6 @@ public class BinaryDictionary extends Dictionary {
            }
        }

        // TODO: move this test to native code.
        if (composerSize <= 1 && TextUtils.isEmpty(prevWord)) return null;
        final InputPointers ips = composer.getInputPointers();
        final int codesSize = isGesture ? ips.getPointerSize() : composerSize;
        // proximityInfo and/or prevWordForBigrams may not be null.
+4 −6
Original line number Diff line number Diff line
@@ -194,12 +194,10 @@ public class Suggest {
        }
        if (wordComposerForLookup.size() <= 1) {
            // At first character typed, search only the bigrams
            if (!TextUtils.isEmpty(prevWordForBigram)) {
            for (final String key : mDictionaries.keySet()) {
                final Dictionary dictionary = mDictionaries.get(key);
                    suggestionsSet.addAll(dictionary.getSuggestions(wordComposerForLookup,
                            prevWordForBigram, proximityInfo));
                }
                suggestionsSet.addAll(dictionary.getSuggestions(
                        wordComposerForLookup, prevWordForBigram, proximityInfo));
            }
        } else {
            // At second character typed, search the unigrams (scores being affected by bigrams)
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ class Dictionary {

    int getBigrams(const int32_t *word, int length, int *codes, int codesSize,
            unsigned short *outWords, int *frequencies) const {
        if (length <= 0) return 0;
        return mBigramDictionary->getBigrams(word, length, codes, codesSize, outWords, frequencies);
    }