From 432789ac93c759da9e59398e21df6982bb354e92 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 30 Jun 2011 17:50:48 +0900 Subject: [PATCH] Internal cleanup Moving functions around, renaming parameters Change-Id: I3ab480f483d7d9700b9328cb07b16b51005098e5 --- native/src/unigram_dictionary.cpp | 4 ++-- native/src/unigram_dictionary.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp index 3c25eda03..334f38e5b 100644 --- a/native/src/unigram_dictionary.cpp +++ b/native/src/unigram_dictionary.cpp @@ -1033,7 +1033,7 @@ inline bool UnigramDictionary::processCurrentNode(const int pos, const int depth const int diffs, const int skipPos, const int excessivePos, const int transposedPos, int *nextLetters, const int nextLettersSize, int *newCount, int *newChildPosition, bool *newTraverseAllNodes, int *newMatchRate, int *newInputIndex, int *newDiffs, - int *nextSiblingPosition, int *nextOutputIndex) { + int *nextSiblingPosition, int *newOutputIndex) { if (DEBUG_DICT) { int inputCount = 0; if (skipPos >= 0) ++inputCount; @@ -1053,7 +1053,7 @@ inline bool UnigramDictionary::processCurrentNode(const int pos, const int depth *nextSiblingPosition = Dictionary::setDictionaryValues(DICT_ROOT, IS_LATEST_DICT_VERSION, pos, &c, &childPosition, &terminal, &freq); - *nextOutputIndex = depth + 1; + *newOutputIndex = depth + 1; const bool needsToTraverseChildrenNodes = childPosition != 0; diff --git a/native/src/unigram_dictionary.h b/native/src/unigram_dictionary.h index 1aeace63c..184e85437 100644 --- a/native/src/unigram_dictionary.h +++ b/native/src/unigram_dictionary.h @@ -87,6 +87,9 @@ private: bool *newTraverseAllNodes, int *newSnr, int*newInputIndex, int *newDiffs, int *nextSiblingPosition, int *nextOutputIndex); bool existsAdjacentProximityChars(const int inputIndex, const int inputLength) const; + inline const int* getInputCharsAt(const int index) const { + return mInputCodes + (index * MAX_PROXIMITY_CHARS); + } void getWordsRec(const int childrenCount, const int pos, const int depth, const int maxDepth, const bool traverseAllNodes, const int snr, const int inputIndex, const int diffs, const int skipPos, const int excessivePos, const int transposedPos, int *nextLetters, @@ -101,9 +104,6 @@ private: bool processCurrentNodeForExactMatch(const int firstChildPos, const int startInputIndex, const int depth, unsigned short *word, int *newChildPosition, int *newCount, bool *newTerminal, int *newFreq, int *siblingPos); - inline const int* getInputCharsAt(const int index) const { - return mInputCodes + (index * MAX_PROXIMITY_CHARS); - } const uint8_t* const DICT_ROOT; const int MAX_WORD_LENGTH;