aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/proximity_info_state.cpp
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-03-07 13:06:32 +0900
committerSatoshi Kataoka <satok@google.com>2013-03-07 13:23:02 +0900
commitf4425aaae971fe78d44530ebe01cf7a59b2e47aa (patch)
tree74a6455cbcfa01e63995b42eff21ba2209a1ebed /native/jni/src/proximity_info_state.cpp
parent2192d08b9cca6a40d834d6a5001d19b5845ed8a0 (diff)
downloadlatinime-f4425aaae971fe78d44530ebe01cf7a59b2e47aa.tar.gz
latinime-f4425aaae971fe78d44530ebe01cf7a59b2e47aa.tar.xz
latinime-f4425aaae971fe78d44530ebe01cf7a59b2e47aa.zip
Refactor ProximityType and CorrectionType
Bug: 8277656 Change-Id: Ia7940bbf81fcf4ff5eb7869b105d98aa34155d33
Diffstat (limited to 'native/jni/src/proximity_info_state.cpp')
-rw-r--r--native/jni/src/proximity_info_state.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/native/jni/src/proximity_info_state.cpp b/native/jni/src/proximity_info_state.cpp
index 7ec3c5400..fe1c43320 100644
--- a/native/jni/src/proximity_info_state.cpp
+++ b/native/jni/src/proximity_info_state.cpp
@@ -197,15 +197,15 @@ ProximityType ProximityInfoState::getProximityType(const int index, const int co
// The first char in the array is what user typed. If it matches right away, that means the
// user typed that same char for this pos.
if (firstCodePoint == baseLowerC || firstCodePoint == codePoint) {
- return EQUIVALENT_CHAR;
+ return MATCH_CHAR;
}
- if (!checkProximityChars) return UNRELATED_CHAR;
+ if (!checkProximityChars) return SUBSTITUTION_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 typed. Treat it as a close char.
if (toBaseLowerCase(firstCodePoint) == baseLowerC) {
- return NEAR_PROXIMITY_CHAR;
+ return PROXIMITY_CHAR;
}
// Not an exact nor an accent-alike match: search the list of close keys
@@ -218,7 +218,7 @@ ProximityType ProximityInfoState::getProximityType(const int index, const int co
if (proximityIndex) {
*proximityIndex = j;
}
- return NEAR_PROXIMITY_CHAR;
+ return PROXIMITY_CHAR;
}
++j;
}
@@ -238,23 +238,23 @@ ProximityType ProximityInfoState::getProximityType(const int index, const int co
++j;
}
}
- // Was not included, signal this as an unrelated character.
- return UNRELATED_CHAR;
+ // Was not included, signal this as a substitution character.
+ return SUBSTITUTION_CHAR;
}
ProximityType ProximityInfoState::getProximityTypeG(const int index, const int codePoint) const {
if (!isUsed()) {
- return UNRELATED_NOR_SUBSTITUTION_CHAR;
+ return UNRELATED_CHAR;
}
const int lowerCodePoint = toLowerCase(codePoint);
const int baseLowerCodePoint = toBaseCodePoint(lowerCodePoint);
for (int i = 0; i < static_cast<int>(mSampledSearchKeyVectors[index].size()); ++i) {
if (mSampledSearchKeyVectors[index][i] == lowerCodePoint
|| mSampledSearchKeyVectors[index][i] == baseLowerCodePoint) {
- return EQUIVALENT_CHAR;
+ return MATCH_CHAR;
}
}
- return UNRELATED_NOR_SUBSTITUTION_CHAR;
+ return UNRELATED_CHAR;
}
bool ProximityInfoState::isKeyInSerchKeysAfterIndex(const int index, const int keyId) const {