diff options
Diffstat (limited to 'native/src/correction_state.h')
-rw-r--r-- | native/src/correction_state.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/native/src/correction_state.h b/native/src/correction_state.h index 267deda9b..93f8a8aab 100644 --- a/native/src/correction_state.h +++ b/native/src/correction_state.h @@ -28,12 +28,25 @@ struct CorrectionState { int mSiblingPos; uint16_t mChildCount; uint8_t mInputIndex; + uint8_t mProximityCount; + uint8_t mTransposedCount; + uint8_t mExcessiveCount; uint8_t mSkippedCount; + + int8_t mTransposedPos; + int8_t mExcessivePos; int8_t mSkipPos; // should be signed + + // TODO: int? + bool mLastCharExceeded; + bool mMatching; + bool mTransposing; + bool mExceeding; bool mSkipping; bool mProximityMatching; + bool mNeedsToTraverseAllNodes; }; @@ -43,14 +56,27 @@ inline static void initCorrectionState(CorrectionState *state, const int rootPos state->mParentIndex = -1; state->mChildCount = childCount; state->mInputIndex = 0; - state->mProximityCount = 0; state->mSiblingPos = rootPos; + state->mNeedsToTraverseAllNodes = traverseAll; + + state->mTransposedPos = -1; + state->mExcessivePos = -1; + state->mSkipPos = -1; + + + state->mProximityCount = 0; + state->mTransposedCount = 0; + state->mExcessiveCount = 0; state->mSkippedCount = 0; + + state->mLastCharExceeded = false; + state->mMatching = false; - state->mSkipping = false; state->mProximityMatching = false; - state->mNeedsToTraverseAllNodes = traverseAll; - state->mSkipPos = -1; + state->mTransposing = false; + state->mExceeding = false; + state->mSkipping = false; + } } // namespace latinime |