aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/correction.h
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-05-30 17:28:34 +0900
committerSatoshi Kataoka <satok@google.com>2012-05-30 18:43:23 +0900
commit6cbe204fce109fab652da15f4c8ea1ae35fca3e7 (patch)
tree620b39db6ddc49ccc1a77c959077d99b764b51ae /native/jni/src/correction.h
parent4f78f8cb795a754bbe36b3334cb77e2a5b59c278 (diff)
downloadlatinime-6cbe204fce109fab652da15f4c8ea1ae35fca3e7.tar.gz
latinime-6cbe204fce109fab652da15f4c8ea1ae35fca3e7.tar.xz
latinime-6cbe204fce109fab652da15f4c8ea1ae35fca3e7.zip
Fix the performance issue on suggesting aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Bug: 6576793 Change-Id: I46f56654cd25dc28668ad75ac71e0e3beb8cdcf3
Diffstat (limited to 'native/jni/src/correction.h')
-rw-r--r--native/jni/src/correction.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/native/jni/src/correction.h b/native/jni/src/correction.h
index 1ac4b8782..3300a8491 100644
--- a/native/jni/src/correction.h
+++ b/native/jni/src/correction.h
@@ -94,6 +94,7 @@ class Correction {
}
Correction(const int typedLetterMultiplier, const int fullWordMultiplier);
+ void resetCorrection();
void initCorrection(
const ProximityInfo *pi, const int inputLength, const int maxWordLength);
void initCorrectionState(const int rootPos, const int childCount, const bool traverseAll);
@@ -129,6 +130,10 @@ class Correction {
bool needsToPrune() const;
+ int pushAndGetTotalTraverseCount() {
+ return ++mTotalTraverseCount;
+ }
+
int getFreqForSplitMultipleWords(
const int *freqArray, const int *wordLengthArray, const int wordCount,
const bool isSpaceProximity, const unsigned short *word);
@@ -200,6 +205,8 @@ class Correction {
int mTerminalOutputIndex;
int mMaxErrors;
+ uint8_t mTotalTraverseCount;
+
// The following arrays are state buffer.
unsigned short mWord[MAX_WORD_LENGTH_INTERNAL];
int mDistances[MAX_WORD_LENGTH_INTERNAL];