diff options
author | 2011-08-08 21:10:58 -0700 | |
---|---|---|
committer | 2011-08-08 21:10:58 -0700 | |
commit | 33f3b60cf0660ad5893c1463077a47a03ac6bcf9 (patch) | |
tree | 4442b2bfa07426a2d55a14692d19470c4ed7e5f9 /native/src/proximity_info.cpp | |
parent | 39d2a4c00548ad547236ffaabbbe87877da9eedf (diff) | |
parent | 985312e88f11e3ce61f35191df59c6bdf9e80e79 (diff) | |
download | latinime-33f3b60cf0660ad5893c1463077a47a03ac6bcf9.tar.gz latinime-33f3b60cf0660ad5893c1463077a47a03ac6bcf9.tar.xz latinime-33f3b60cf0660ad5893c1463077a47a03ac6bcf9.zip |
Merge "Refactor the correction algorithm related to missing character correction"
Diffstat (limited to 'native/src/proximity_info.cpp')
-rw-r--r-- | native/src/proximity_info.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/native/src/proximity_info.cpp b/native/src/proximity_info.cpp index bed92cf9e..d437e251a 100644 --- a/native/src/proximity_info.cpp +++ b/native/src/proximity_info.cpp @@ -114,10 +114,7 @@ bool ProximityInfo::existsAdjacentProximityChars(const int index) const { // in their list. The non-accented version of the character should be considered // "close", but not the other keys close to the non-accented version. ProximityInfo::ProximityType ProximityInfo::getMatchedProximityId( - const int index, const unsigned short c, CorrectionState *correctionState) const { - const int skipPos = correctionState->getSkipPos(); - const int excessivePos = correctionState->getExcessivePos(); - const int transposedPos = correctionState->getTransposedPos(); + const int index, const unsigned short c, const bool checkProximityChars) const { const int *currentChars = getProximityCharsAt(index); const unsigned short baseLowerC = Dictionary::toBaseLowerCase(c); @@ -126,9 +123,7 @@ ProximityInfo::ProximityType ProximityInfo::getMatchedProximityId( if (currentChars[0] == baseLowerC || currentChars[0] == c) return SAME_OR_ACCENTED_OR_CAPITALIZED_CHAR; - // If one of those is true, we should not check for close characters at all. - if (skipPos >= 0 || excessivePos >= 0 || transposedPos >= 0) - return UNRELATED_CHAR; + if (!checkProximityChars) return UNRELATED_CHAR; // If the non-accented, lowercased version of that first character matches c, // then we have a non-accented version of the accented character the user |