Merge "Fix: "saomething" -> "something"."
commit
0b358a448c
|
@ -328,12 +328,12 @@ class DicNode {
|
||||||
return mDicNodeState.mDicNodeStatePrevWord.getPrevWordCount() > 0;
|
return mDicNodeState.mDicNodeStatePrevWord.getPrevWordCount() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
float getProximityCorrectionCount() const {
|
int getProximityCorrectionCount() const {
|
||||||
return static_cast<float>(mDicNodeState.mDicNodeStateScoring.getProximityCorrectionCount());
|
return mDicNodeState.mDicNodeStateScoring.getProximityCorrectionCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
float getEditCorrectionCount() const {
|
int getEditCorrectionCount() const {
|
||||||
return static_cast<float>(mDicNodeState.mDicNodeStateScoring.getEditCorrectionCount());
|
return mDicNodeState.mDicNodeStateScoring.getEditCorrectionCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used to prune nodes
|
// Used to prune nodes
|
||||||
|
|
|
@ -22,12 +22,14 @@ const float ScoringParams::MAX_SPATIAL_DISTANCE = 1.0f;
|
||||||
const int ScoringParams::THRESHOLD_NEXT_WORD_PROBABILITY = 40;
|
const int ScoringParams::THRESHOLD_NEXT_WORD_PROBABILITY = 40;
|
||||||
const int ScoringParams::THRESHOLD_NEXT_WORD_PROBABILITY_FOR_CAPPED = 120;
|
const int ScoringParams::THRESHOLD_NEXT_WORD_PROBABILITY_FOR_CAPPED = 120;
|
||||||
const float ScoringParams::AUTOCORRECT_OUTPUT_THRESHOLD = 1.0f;
|
const float ScoringParams::AUTOCORRECT_OUTPUT_THRESHOLD = 1.0f;
|
||||||
const int ScoringParams::MAX_CACHE_DIC_NODE_SIZE = 125;
|
// TODO: Unlimit max cache dic node size
|
||||||
|
const int ScoringParams::MAX_CACHE_DIC_NODE_SIZE = 170;
|
||||||
const int ScoringParams::THRESHOLD_SHORT_WORD_LENGTH = 4;
|
const int ScoringParams::THRESHOLD_SHORT_WORD_LENGTH = 4;
|
||||||
|
|
||||||
const float ScoringParams::DISTANCE_WEIGHT_LENGTH = 0.132f;
|
const float ScoringParams::DISTANCE_WEIGHT_LENGTH = 0.132f;
|
||||||
const float ScoringParams::PROXIMITY_COST = 0.086f;
|
const float ScoringParams::PROXIMITY_COST = 0.095f;
|
||||||
const float ScoringParams::FIRST_PROXIMITY_COST = 0.104f;
|
const float ScoringParams::FIRST_CHAR_PROXIMITY_COST = 0.102f;
|
||||||
|
const float ScoringParams::FIRST_PROXIMITY_COST = 0.019f;
|
||||||
const float ScoringParams::OMISSION_COST = 0.458f;
|
const float ScoringParams::OMISSION_COST = 0.458f;
|
||||||
const float ScoringParams::OMISSION_COST_SAME_CHAR = 0.491f;
|
const float ScoringParams::OMISSION_COST_SAME_CHAR = 0.491f;
|
||||||
const float ScoringParams::OMISSION_COST_FIRST_CHAR = 0.582f;
|
const float ScoringParams::OMISSION_COST_FIRST_CHAR = 0.582f;
|
||||||
|
@ -35,19 +37,19 @@ const float ScoringParams::INSERTION_COST = 0.730f;
|
||||||
const float ScoringParams::INSERTION_COST_SAME_CHAR = 0.586f;
|
const float ScoringParams::INSERTION_COST_SAME_CHAR = 0.586f;
|
||||||
const float ScoringParams::INSERTION_COST_PROXIMITY_CHAR = 0.70f;
|
const float ScoringParams::INSERTION_COST_PROXIMITY_CHAR = 0.70f;
|
||||||
const float ScoringParams::INSERTION_COST_FIRST_CHAR = 0.623f;
|
const float ScoringParams::INSERTION_COST_FIRST_CHAR = 0.623f;
|
||||||
const float ScoringParams::TRANSPOSITION_COST = 0.516f;
|
const float ScoringParams::TRANSPOSITION_COST = 0.526f;
|
||||||
const float ScoringParams::SPACE_SUBSTITUTION_COST = 0.319f;
|
const float ScoringParams::SPACE_SUBSTITUTION_COST = 0.319f;
|
||||||
const float ScoringParams::ADDITIONAL_PROXIMITY_COST = 0.380f;
|
const float ScoringParams::ADDITIONAL_PROXIMITY_COST = 0.380f;
|
||||||
const float ScoringParams::SUBSTITUTION_COST = 0.403f;
|
const float ScoringParams::SUBSTITUTION_COST = 0.383f;
|
||||||
const float ScoringParams::COST_NEW_WORD = 0.042f;
|
const float ScoringParams::COST_NEW_WORD = 0.042f;
|
||||||
const float ScoringParams::COST_SECOND_OR_LATER_WORD_FIRST_CHAR_UPPERCASE = 0.25f;
|
const float ScoringParams::COST_SECOND_OR_LATER_WORD_FIRST_CHAR_UPPERCASE = 0.25f;
|
||||||
const float ScoringParams::DISTANCE_WEIGHT_LANGUAGE = 1.123f;
|
const float ScoringParams::DISTANCE_WEIGHT_LANGUAGE = 1.123f;
|
||||||
const float ScoringParams::COST_FIRST_LOOKAHEAD = 0.545f;
|
const float ScoringParams::COST_FIRST_LOOKAHEAD = 0.545f;
|
||||||
const float ScoringParams::COST_LOOKAHEAD = 0.073f;
|
const float ScoringParams::COST_LOOKAHEAD = 0.073f;
|
||||||
const float ScoringParams::HAS_PROXIMITY_TERMINAL_COST = 0.105f;
|
const float ScoringParams::HAS_PROXIMITY_TERMINAL_COST = 0.093f;
|
||||||
const float ScoringParams::HAS_EDIT_CORRECTION_TERMINAL_COST = 0.038f;
|
const float ScoringParams::HAS_EDIT_CORRECTION_TERMINAL_COST = 0.041f;
|
||||||
const float ScoringParams::HAS_MULTI_WORD_TERMINAL_COST = 0.444f;
|
const float ScoringParams::HAS_MULTI_WORD_TERMINAL_COST = 0.447f;
|
||||||
const float ScoringParams::TYPING_BASE_OUTPUT_SCORE = 1.0f;
|
const float ScoringParams::TYPING_BASE_OUTPUT_SCORE = 1.0f;
|
||||||
const float ScoringParams::TYPING_MAX_OUTPUT_SCORE_PER_INPUT = 0.1f;
|
const float ScoringParams::TYPING_MAX_OUTPUT_SCORE_PER_INPUT = 0.1f;
|
||||||
const float ScoringParams::NORMALIZED_SPATIAL_DISTANCE_THRESHOLD_FOR_EDIT = 0.06f;
|
const float ScoringParams::NORMALIZED_SPATIAL_DISTANCE_THRESHOLD_FOR_EDIT = 0.045f;
|
||||||
} // namespace latinime
|
} // namespace latinime
|
||||||
|
|
|
@ -36,6 +36,7 @@ class ScoringParams {
|
||||||
// TODO: explore optimization of gesture parameters.
|
// TODO: explore optimization of gesture parameters.
|
||||||
static const float DISTANCE_WEIGHT_LENGTH;
|
static const float DISTANCE_WEIGHT_LENGTH;
|
||||||
static const float PROXIMITY_COST;
|
static const float PROXIMITY_COST;
|
||||||
|
static const float FIRST_CHAR_PROXIMITY_COST;
|
||||||
static const float FIRST_PROXIMITY_COST;
|
static const float FIRST_PROXIMITY_COST;
|
||||||
static const float OMISSION_COST;
|
static const float OMISSION_COST;
|
||||||
static const float OMISSION_COST_SAME_CHAR;
|
static const float OMISSION_COST_SAME_CHAR;
|
||||||
|
|
|
@ -81,8 +81,11 @@ class TypingWeighting : public Weighting {
|
||||||
|
|
||||||
const bool isFirstChar = pointIndex == 0;
|
const bool isFirstChar = pointIndex == 0;
|
||||||
const bool isProximity = isProximityDicNode(traverseSession, dicNode);
|
const bool isProximity = isProximityDicNode(traverseSession, dicNode);
|
||||||
float cost = isProximity ? (isFirstChar ? ScoringParams::FIRST_PROXIMITY_COST
|
float cost = isProximity ? (isFirstChar ? ScoringParams::FIRST_CHAR_PROXIMITY_COST
|
||||||
: ScoringParams::PROXIMITY_COST) : 0.0f;
|
: ScoringParams::PROXIMITY_COST) : 0.0f;
|
||||||
|
if (isProximity && dicNode->getProximityCorrectionCount() == 0) {
|
||||||
|
cost += ScoringParams::FIRST_PROXIMITY_COST;
|
||||||
|
}
|
||||||
if (dicNode->getNodeCodePointCount() == 2) {
|
if (dicNode->getNodeCodePointCount() == 2) {
|
||||||
// At the second character of the current word, we check if the first char is uppercase
|
// At the second character of the current word, we check if the first char is uppercase
|
||||||
// and the word is a second or later word of a multiple word suggestion. We demote it
|
// and the word is a second or later word of a multiple word suggestion. We demote it
|
||||||
|
|
Loading…
Reference in New Issue