diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h index 4c57af0ba..4e6ff9556 100644 --- a/native/jni/src/defines.h +++ b/native/jni/src/defines.h @@ -344,10 +344,6 @@ static inline void prof_out(void) { #define MAX_POINTER_COUNT 1 #define MAX_POINTER_COUNT_G 2 -// DEBUG -#define INPUTLENGTH_FOR_DEBUG (-1) -#define MIN_OUTPUT_INDEX_FOR_DEBUG (-1) - #define DISALLOW_DEFAULT_CONSTRUCTOR(TypeName) \ TypeName() = delete diff --git a/native/jni/src/suggest/policyimpl/typing/typing_scoring.h b/native/jni/src/suggest/policyimpl/typing/typing_scoring.h index 7ef905df7..8982800b7 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_scoring.h +++ b/native/jni/src/suggest/policyimpl/typing/typing_scoring.h @@ -32,25 +32,24 @@ class TypingScoring : public Scoring { public: static const TypingScoring *getInstance() { return &sInstance; } - AK_FORCE_INLINE bool getMostProbableString( - const DicTraverseSession *const traverseSession, const int terminalSize, - const float languageWeight, int *const outputCodePoints, int *const type, - int *const freq) const { + AK_FORCE_INLINE bool getMostProbableString(const DicTraverseSession *const traverseSession, + const int terminalSize, const float languageWeight, int *const outputCodePoints, + int *const type, int *const freq) const { return false; } - AK_FORCE_INLINE void safetyNetForMostProbableString(const int scoreCount, - const int maxScore, int *const outputCodePoints, int *const scores) const { + AK_FORCE_INLINE void safetyNetForMostProbableString(const int scoreCount, const int maxScore, + int *const outputCodePoints, int *const scores) const { } AK_FORCE_INLINE float getAdjustedLanguageWeight(DicTraverseSession *const traverseSession, - DicNode *const terminals, const int size) const { + DicNode *const terminals, const int size) const { return 1.0f; } - AK_FORCE_INLINE int calculateFinalScore(const float compoundDistance, - const int inputSize, const ErrorTypeUtils::ErrorType containedErrorTypes, - const bool forceCommit, const bool boostExactMatches) const { + AK_FORCE_INLINE int calculateFinalScore(const float compoundDistance, const int inputSize, + const ErrorTypeUtils::ErrorType containedErrorTypes, const bool forceCommit, + const bool boostExactMatches) const { const float maxDistance = ScoringParams::DISTANCE_WEIGHT_LANGUAGE + static_cast(inputSize) * ScoringParams::TYPING_MAX_OUTPUT_SCORE_PER_INPUT; float score = ScoringParams::TYPING_BASE_OUTPUT_SCORE - compoundDistance / maxDistance; @@ -85,8 +84,8 @@ class TypingScoring : public Scoring { return true; } - AK_FORCE_INLINE bool sameAsTyped( - const DicTraverseSession *const traverseSession, const DicNode *const dicNode) const { + AK_FORCE_INLINE bool sameAsTyped(const DicTraverseSession *const traverseSession, + const DicNode *const dicNode) const { return traverseSession->getProximityInfoState(0)->sameAsTyped( dicNode->getOutputWordBuf(), dicNode->getNodeCodePointCount()); } diff --git a/native/jni/src/suggest/policyimpl/typing/typing_weighting.h b/native/jni/src/suggest/policyimpl/typing/typing_weighting.h index 41314ef52..b36605af9 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_weighting.h +++ b/native/jni/src/suggest/policyimpl/typing/typing_weighting.h @@ -72,8 +72,6 @@ class TypingWeighting : public Weighting { float getMatchedCost(const DicTraverseSession *const traverseSession, const DicNode *const dicNode, DicNode_InputStateG *inputStateG) const { const int pointIndex = dicNode->getInputIndex(0); - // Note: min() required since length can be MAX_POINT_TO_KEY_LENGTH for characters not on - // the keyboard (like accented letters) const float normalizedSquaredLength = traverseSession->getProximityInfoState(0) ->getPointToKeyLength(pointIndex, CharUtils::toBaseLowerCase(dicNode->getNodeCodePoint()));