Some more misc cleanups

Change-Id: I88cb6d38d73a2a68ade2f2190910f4733cd7b668
main
Ken Wakasa 2013-01-29 19:52:04 +09:00
parent 3d0477fbd2
commit ca008d82d4
3 changed files with 7 additions and 7 deletions

View File

@ -112,7 +112,7 @@ void Correction::setCorrectionParams(const int skipPos, const int excessivePos,
mMaxErrors = maxErrors; mMaxErrors = maxErrors;
} }
void Correction::checkState() { void Correction::checkState() const {
if (DEBUG_DICT) { if (DEBUG_DICT) {
int inputCount = 0; int inputCount = 0;
if (mSkipPos >= 0) ++inputCount; if (mSkipPos >= 0) ++inputCount;
@ -121,12 +121,12 @@ void Correction::checkState() {
} }
} }
bool Correction::sameAsTyped() { bool Correction::sameAsTyped() const {
return mProximityInfoState.sameAsTyped(mWord, mOutputIndex); return mProximityInfoState.sameAsTyped(mWord, mOutputIndex);
} }
int Correction::getFreqForSplitMultipleWords(const int *freqArray, const int *wordLengthArray, int Correction::getFreqForSplitMultipleWords(const int *freqArray, const int *wordLengthArray,
const int wordCount, const bool isSpaceProximity, const int *word) { const int wordCount, const bool isSpaceProximity, const int *word) const {
return Correction::RankingAlgorithm::calcFreqForSplitMultipleWords(freqArray, wordLengthArray, return Correction::RankingAlgorithm::calcFreqForSplitMultipleWords(freqArray, wordLengthArray,
wordCount, this, isSpaceProximity, word); wordCount, this, isSpaceProximity, word);
} }

View File

@ -64,8 +64,8 @@ class Correction {
void setCorrectionParams(const int skipPos, const int excessivePos, const int transposedPos, void setCorrectionParams(const int skipPos, const int excessivePos, const int transposedPos,
const int spaceProximityPos, const int missingSpacePos, const bool useFullEditDistance, const int spaceProximityPos, const int missingSpacePos, const bool useFullEditDistance,
const bool doAutoCompletion, const int maxErrors); const bool doAutoCompletion, const int maxErrors);
void checkState(); void checkState() const;
bool sameAsTyped(); bool sameAsTyped() const;
bool initProcessState(const int index); bool initProcessState(const int index);
int getInputIndex() const; int getInputIndex() const;
@ -77,7 +77,7 @@ class Correction {
} }
int getFreqForSplitMultipleWords(const int *freqArray, const int *wordLengthArray, int getFreqForSplitMultipleWords(const int *freqArray, const int *wordLengthArray,
const int wordCount, const bool isSpaceProximity, const int *word); const int wordCount, const bool isSpaceProximity, const int *word) const;
int getFinalProbability(const int probability, int **word, int *wordLength); int getFinalProbability(const int probability, int **word, int *wordLength);
int getFinalProbabilityForSubQueue(const int probability, int **word, int *wordLength, int getFinalProbabilityForSubQueue(const int probability, int **word, int *wordLength,
const int inputSize); const int inputSize);

View File

@ -87,7 +87,7 @@ class WordsPriorityQueue {
} }
} }
SuggestedWord *top() { SuggestedWord *top() const {
if (mSuggestions.empty()) return 0; if (mSuggestions.empty()) return 0;
SuggestedWord *sw = mSuggestions.top(); SuggestedWord *sw = mSuggestions.top();
return sw; return sw;