Improve gesture input scoring method 2.
Align next key to path bases its scoring method on probabilities.
Change-Id: I5247c965b92c0052bfdab8a9b1027bc86eb33218
diff --git a/native/jni/src/proximity_info.cpp b/native/jni/src/proximity_info.cpp
index fde93b5..e2aa156 100644
--- a/native/jni/src/proximity_info.cpp
+++ b/native/jni/src/proximity_info.cpp
@@ -239,6 +239,9 @@
// We do not have the coordinate data
return NOT_AN_INDEX;
}
+ if (c == NOT_A_CODE_POINT) {
+ return NOT_AN_INDEX;
+ }
const int lowerCode = static_cast<int>(toLowerCase(c));
hash_map_compat<int, int>::const_iterator mapPos = mCodeToKeyMap.find(lowerCode);
if (mapPos != mCodeToKeyMap.end()) {
@@ -296,9 +299,7 @@
return 0;
}
-int ProximityInfo::getKeyKeyDistanceG(int key0, int key1) const {
- const int keyId0 = getKeyIndexOf(key0);
- const int keyId1 = getKeyIndexOf(key1);
+int ProximityInfo::getKeyKeyDistanceG(const int keyId0, const int keyId1) const {
if (keyId0 >= 0 && keyId1 >= 0) {
return mKeyKeyDistancesG[keyId0][keyId1];
}