Home
last modified time | relevance | path

Searched refs:afterLength (Results 1 – 4 of 4) sorted by relevance

/packages/inputmethods/LatinIME/native/jni/src/suggest/policyimpl/utils/
Dedit_distance.h32 const int afterLength = policy->getString1Length(); in getEditDistance() local
33 float dp[(beforeLength + 1) * (afterLength + 1)]; in getEditDistance()
35 dp[(afterLength + 1) * i] = i * policy->getInsertionCost(i - 1, -1); in getEditDistance()
37 for (int i = 0; i <= afterLength; ++i) { in getEditDistance()
42 for (int j = 0; j < afterLength; ++j) { in getEditDistance()
43 dp[(afterLength + 1) * (i + 1) + (j + 1)] = std::min( in getEditDistance()
44 dp[(afterLength + 1) * i + (j + 1)] + policy->getInsertionCost(i, j), in getEditDistance()
46 dp[(afterLength + 1) * (i + 1) + j] + policy->getDeletionCost(i, j), in getEditDistance()
47 dp[(afterLength + 1) * i + j] + policy->getSubstitutionCost(i, j))); in getEditDistance()
49 dp[(afterLength + 1) * (i + 1) + (j + 1)] = std::min( in getEditDistance()
[all …]
/packages/inputmethods/LatinIME/native/jni/src/utils/
Dautocorrection_threshold_utils.cpp33 const int beforeLength, const int *after, const int afterLength) { in editDistance() argument
35 before, beforeLength, after, afterLength); in editDistance()
71 const int beforeLength, const int *after, const int afterLength, const int score) { in calcNormalizedScore() argument
72 if (0 == beforeLength || 0 == afterLength) { in calcNormalizedScore()
75 const int distance = editDistance(before, beforeLength, after, afterLength); in calcNormalizedScore()
77 for (int i = 0; i < afterLength; ++i) { in calcNormalizedScore()
83 if (spaceCount == afterLength) { in calcNormalizedScore()
87 if (score <= 0 || distance >= afterLength) { in calcNormalizedScore()
93 const float weight = 1.0f - static_cast<float>(distance) / static_cast<float>(afterLength); in calcNormalizedScore()
103 static_cast<float>(std::min(beforeLength, afterLength - spaceCount))) in calcNormalizedScore()
Dautocorrection_threshold_utils.h27 const int *after, const int afterLength, const int score);
29 const int afterLength);
/packages/inputmethods/LatinIME/native/jni/
Dcom_android_inputmethod_latin_BinaryDictionaryUtils.cpp62 jsize afterLength = env->GetArrayLength(after); in latinime_BinaryDictionaryUtils_calcNormalizedScore() local
64 int afterCodePoints[afterLength]; in latinime_BinaryDictionaryUtils_calcNormalizedScore()
66 env->GetIntArrayRegion(after, 0, afterLength, afterCodePoints); in latinime_BinaryDictionaryUtils_calcNormalizedScore()
68 afterCodePoints, afterLength, score); in latinime_BinaryDictionaryUtils_calcNormalizedScore()