diff options
author | 2012-10-11 13:08:06 +0900 | |
---|---|---|
committer | 2012-10-11 13:08:06 +0900 | |
commit | ff74cc3e5e75fc0c6b9ffaa5e68d879775dc6115 (patch) | |
tree | 3264e82e9879f61241a0fc7131fce8e473f04317 /native/jni/src/proximity_info.cpp | |
parent | 76cec53f3b7af7e6591e527cc080d9f25ff72457 (diff) | |
download | latinime-ff74cc3e5e75fc0c6b9ffaa5e68d879775dc6115.tar.gz latinime-ff74cc3e5e75fc0c6b9ffaa5e68d879775dc6115.tar.xz latinime-ff74cc3e5e75fc0c6b9ffaa5e68d879775dc6115.zip |
Improve gesture input scoring method 2.
Align next key to path bases its scoring method on probabilities.
Change-Id: I5247c965b92c0052bfdab8a9b1027bc86eb33218
Diffstat (limited to 'native/jni/src/proximity_info.cpp')
-rw-r--r-- | native/jni/src/proximity_info.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/native/jni/src/proximity_info.cpp b/native/jni/src/proximity_info.cpp index fde93b5a9..e2aa15674 100644 --- a/native/jni/src/proximity_info.cpp +++ b/native/jni/src/proximity_info.cpp @@ -239,6 +239,9 @@ int ProximityInfo::getKeyIndexOf(const int c) const { // 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 @@ int ProximityInfo::getKeyCenterYOfKeyIdG(int keyId) const { 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]; } |