Fix last excessive char correction handling

Change-Id: Id1d46cd96e041fbbbee995093ef8ca56daa3b383
main
satok 2011-08-19 18:22:28 +09:00
parent 890d10bd1e
commit 6d78302155
1 changed files with 6 additions and 1 deletions

View File

@ -212,6 +212,12 @@ Correction::CorrectionType Correction::processCharAndCalcState(
const int32_t c, const bool isTerminal) {
if (mNeedsToTraverseAllNodes || isQuote(c)) {
if (mLastCharExceeded > 0 && mInputIndex == mInputLength - 1
&& mProximityInfo->getMatchedProximityId(mInputIndex, c, false)
== ProximityInfo::SAME_OR_ACCENTED_OR_CAPITALIZED_CHAR) {
mLastCharExceeded = false;
--mExcessiveCount;
}
return processSkipChar(c, isTerminal);
}
@ -312,7 +318,6 @@ Correction::CorrectionType Correction::processCharAndCalcState(
&& mExcessivePos >= 0 && (mInputIndex == mInputLength - 2);
const bool isSameAsUserTypedLength = (mInputLength == mInputIndex + 1) || mLastCharExceeded;
if (mLastCharExceeded) {
// TODO: Decrement mExcessiveCount if next char is matched word.
++mExcessiveCount;
}