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

Commit 8cae9f50 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi Committed by Android (Google) Code Review
Browse files

Merge "Implement getMaxProbabilityOfExactMatches()."

parents d66d16f6 d9b8602f
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