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

Commit d9b8602f authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Implement getMaxProbabilityOfExactMatches().

Bug: 13142176
Bug: 15428247
Change-Id: I5be6d683be95505412615ca7c88260de1ea05f54
parent 3ca65c8f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -356,6 +356,7 @@ public final class BinaryDictionary extends Dictionary {
        return getProbabilityNative(mNativeDict, codePoints);
    }

    @Override
    public int getMaxFrequencyOfExactMatches(final String word) {
        if (TextUtils.isEmpty(word)) return NOT_A_PROBABILITY;
        int[] codePoints = StringUtils.toCodePointArray(word);
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ LATIN_IME_CORE_SRC_FILES := \
    $(addprefix suggest/core/dictionary/, \
        bigram_dictionary.cpp \
        dictionary.cpp \
        dictionary_utils.cpp \
        digraph_utils.cpp \
        error_type_utils.cpp \
        multi_bigram_map.cpp \
+1 −2
Original line number Diff line number Diff line
@@ -280,8 +280,7 @@ static jint latinime_BinaryDictionary_getMaxProbabilityOfExactMatches(
    const jsize wordLength = env->GetArrayLength(word);
    int codePoints[wordLength];
    env->GetIntArrayRegion(word, 0, wordLength, codePoints);
    // TODO: Implement.
    return NOT_A_PROBABILITY;
    return dictionary->getMaxProbabilityOfExactMatches(codePoints, wordLength);
}

static jint latinime_BinaryDictionary_getBigramProbability(JNIEnv *env, jclass clazz,
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ class DicNode {
        PROF_NODE_COPY(&dicNode->mProfiler, mProfiler);
    }

    void initAsPassingChild(DicNode *parentDicNode) {
    void initAsPassingChild(const DicNode *parentDicNode) {
        mIsCachedForNextSuggestion = parentDicNode->mIsCachedForNextSuggestion;
        const int codePoint =
                parentDicNode->mDicNodeState.mDicNodeStateOutput.getCurrentWordCodePointAt(
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ namespace latinime {
///////////////////////////////////
// Traverse node expansion utils //
///////////////////////////////////
/* static */ void DicNodeUtils::getAllChildDicNodes(DicNode *dicNode,
/* static */ void DicNodeUtils::getAllChildDicNodes(const DicNode *dicNode,
        const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
        DicNodeVector *const childDicNodes) {
    if (dicNode->isTotalInputSizeExceedingLimit()) {
Loading