diff options
author | 2012-02-01 23:09:51 -0800 | |
---|---|---|
committer | 2012-02-01 23:09:51 -0800 | |
commit | d1ee49a939dab4870dc71d8cc170c2c654435c20 (patch) | |
tree | f84b7084220c6f08f6b825655d1c51832b436755 /native/src/proximity_info.cpp | |
parent | d661845c0b8e3e78c52a218f3e37f6b3785e148a (diff) | |
parent | e05b3f4b3a57dcf99ade35bfbc1e1cdc3c3e476c (diff) | |
download | latinime-d1ee49a939dab4870dc71d8cc170c2c654435c20.tar.gz latinime-d1ee49a939dab4870dc71d8cc170c2c654435c20.tar.xz latinime-d1ee49a939dab4870dc71d8cc170c2c654435c20.zip |
am e05b3f4b: Support additional proximity characters
* commit 'e05b3f4b3a57dcf99ade35bfbc1e1cdc3c3e476c':
Support additional proximity characters
Diffstat (limited to 'native/src/proximity_info.cpp')
-rw-r--r-- | native/src/proximity_info.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/native/src/proximity_info.cpp b/native/src/proximity_info.cpp index e0e938099..b6bab2274 100644 --- a/native/src/proximity_info.cpp +++ b/native/src/proximity_info.cpp @@ -261,7 +261,8 @@ ProximityInfo::ProximityType ProximityInfo::getMatchedProximityId(const int inde // Not an exact nor an accent-alike match: search the list of close keys int j = 1; - while (j < MAX_PROXIMITY_CHARS_SIZE && currentChars[j] > 0) { + while (j < MAX_PROXIMITY_CHARS_SIZE + && currentChars[j] > ADDITIONAL_PROXIMITY_CHAR_DELIMITER_CODE) { const bool matched = (currentChars[j] == baseLowerC || currentChars[j] == c); if (matched) { if (proximityIndex) { @@ -271,6 +272,21 @@ ProximityInfo::ProximityType ProximityInfo::getMatchedProximityId(const int inde } ++j; } + if (j < MAX_PROXIMITY_CHARS_SIZE + && currentChars[j] == ADDITIONAL_PROXIMITY_CHAR_DELIMITER_CODE) { + ++j; + while (j < MAX_PROXIMITY_CHARS_SIZE + && currentChars[j] > ADDITIONAL_PROXIMITY_CHAR_DELIMITER_CODE) { + const bool matched = (currentChars[j] == baseLowerC || currentChars[j] == c); + if (matched) { + if (proximityIndex) { + *proximityIndex = j; + } + return ADDITIONAL_PROXIMITY_CHAR; + } + ++j; + } + } // Was not included, signal this as an unrelated character. return UNRELATED_CHAR; |