Update weighting and max limit

This commit is contained in:
Aleksandras Kostarevas 2024-04-22 10:49:07 -04:00
parent ea166f2750
commit ed5dbe1f2c
5 changed files with 10 additions and 10 deletions

View File

@ -27,7 +27,7 @@ public final class DicTraverseSession {
JniUtils.loadNativeLibrary();
}
// Must be equal to MAX_RESULTS in native/jni/src/defines.h
private static final int MAX_RESULTS = 18;
private static final int MAX_RESULTS = 40;
public final int[] mInputCodePoints =
new int[DecoderSpecificConstants.DICTIONARY_MAX_WORD_LENGTH];
public final int[][] mPrevWordCodePointArrays =

View File

@ -299,7 +299,7 @@ fun RowScope.SuggestionItems(words: SuggestedWords, onClick: (i: Int) -> Unit, o
return
} else if(words.mInputStyle == SuggestedWords.INPUT_STYLE_TAIL_BATCH && maxSuggestions > 1) {
words.mSuggestedWordInfoList.removeAt(0);
//words.mSuggestedWordInfoList.removeAt(0);
}

View File

@ -33,7 +33,7 @@
// Must be equal to Constants.Dictionary.MAX_WORD_LENGTH in Java
#define MAX_WORD_LENGTH 48
// Must be equal to BinaryDictionary.MAX_RESULTS in Java
#define MAX_RESULTS 18
#define MAX_RESULTS 40
// Must be equal to ProximityInfo.MAX_PROXIMITY_CHARS_SIZE in Java
#define MAX_PROXIMITY_CHARS_SIZE 16
#define ADDITIONAL_PROXIMITY_CHAR_DELIMITER_CODE 2
@ -175,8 +175,8 @@ static inline void showStackTrace() {
#endif // defined(FLAG_DO_PROFILE) || defined(FLAG_DBG)
#ifdef FLAG_DBG
//#define DEBUG_DICT true
#define DEBUG_DICT false
#define DEBUG_DICT true
//#define DEBUG_DICT false
#define DEBUG_DICT_FULL false
#define DEBUG_EDIT_DISTANCE false
#define DEBUG_NODE DEBUG_DICT_FULL

View File

@ -73,7 +73,7 @@ public:
}
AK_FORCE_INLINE int getTerminalCacheSize() const override {
return 18;
return MAX_RESULTS;
}
AK_FORCE_INLINE bool isPossibleOmissionChildNode(const DicTraverseSession *const traverseSession,

View File

@ -129,7 +129,7 @@ namespace util {
const float dotDirection = swipedx * linedx + swipedy * linedy;
if (dotDirection < 0.0) {
totalDistance += swipelen * -dotDirection;
totalDistance += 24.0f * swipelen * -dotDirection;
}
}
@ -165,7 +165,7 @@ public:
return MAX_VALUE_FOR_WEIGHTING;
}
float totalDistance = distance * distance;
float totalDistance = distance;// * distance;
if(parentDicNode != nullptr) {
@ -187,7 +187,7 @@ public:
const float extraDistance = 8.0f * util::calcLineDeviationPunishment(
traverseSession, codePoint0, codePoint1, lowerLimit, upperLimit, threshold);
totalDistance += extraDistance;
totalDistance += pow(extraDistance, 1.8f) * 0.1f;
} else {
totalDistance += MAX_VALUE_FOR_WEIGHTING;
}
@ -314,7 +314,7 @@ public:
return MAX_VALUE_FOR_WEIGHTING;
}
totalDistance += punishment;
totalDistance += pow(punishment, 1.4f) * 0.1f;
}
inputStateG->mNeedsToUpdateInputStateG = true;