Several cleanups
Remove obsolete comment and unused macros. Cosmetic fixes as well. Change-Id: I9843331c8ce90d9b10b54f425ea1c7416b57c541
This commit is contained in:
parent
ef27c83e74
commit
622589ab43
3 changed files with 11 additions and 18 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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<float>(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());
|
||||
}
|
||||
|
|
|
@ -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()));
|
||||
|
|
Loading…
Reference in a new issue