diff options
author | 2011-08-03 02:19:44 +0900 | |
---|---|---|
committer | 2011-08-03 20:34:19 +0900 | |
commit | 0f6c8e8aeb18b949fa9586dd9de091027b17e107 (patch) | |
tree | 05a50c283a0f51e0ac6c87061e6641db69f29876 /native/src/correction_state.h | |
parent | e48629001388255cbb21c212a3f8de99176e7f95 (diff) | |
download | latinime-0f6c8e8aeb18b949fa9586dd9de091027b17e107.tar.gz latinime-0f6c8e8aeb18b949fa9586dd9de091027b17e107.tar.xz latinime-0f6c8e8aeb18b949fa9586dd9de091027b17e107.zip |
Move code related to ranking algorithm to correction_state.cpp
Change-Id: I52b34de45969fef82e46d9c10079c2d45e0b94eb
Diffstat (limited to 'native/src/correction_state.h')
-rw-r--r-- | native/src/correction_state.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/native/src/correction_state.h b/native/src/correction_state.h index e03b2a17c..7bbad5f5b 100644 --- a/native/src/correction_state.h +++ b/native/src/correction_state.h @@ -32,7 +32,12 @@ public: void initCorrectionState(const ProximityInfo *pi, const int inputLength); void setCorrectionParams(const int skipPos, const int excessivePos, const int transposedPos, const int spaceProximityPos, const int missingSpacePos); + void initDepth(); void checkState(); + void goUpTree(const int matchCount); + void slideTree(const int matchCount); + void goDownTree(int *matchedCount); + void charMatched(); virtual ~CorrectionState(); int getSkipPos() const { return mSkipPos; @@ -50,13 +55,13 @@ public: return mMissingSpacePos; } int getFreqForSplitTwoWords(const int firstFreq, const int secondFreq); - int getFinalFreq(const int inputIndex, const int depth, const int matchWeight, const int freq, - const bool sameLength); + int getFinalFreq(const int inputIndex, const int outputIndex, const int freq); private: const int TYPED_LETTER_MULTIPLIER; const int FULL_WORD_MULTIPLIER; + const ProximityInfo *mProximityInfo; int mInputLength; int mSkipPos; @@ -65,6 +70,8 @@ private: int mSpaceProximityPos; int mMissingSpacePos; + int mMatchedCharCount; + class RankingAlgorithm { public: static int calculateFinalFreq(const int inputIndex, const int depth, |