aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/defines.h
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-10-09 19:32:05 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-09 19:32:05 -0700
commite8c011679ae2bcc880902d86bc106f37f7d9136f (patch)
tree9e983848fc561be46ab99231af2a25ede1889aeb /native/jni/src/defines.h
parente2598657c3b773ff23283b7f194a49a7d1482a70 (diff)
parente398d09a50486d1b91ce109f4bd1a7529560c634 (diff)
downloadlatinime-e8c011679ae2bcc880902d86bc106f37f7d9136f.tar.gz
latinime-e8c011679ae2bcc880902d86bc106f37f7d9136f.tar.xz
latinime-e8c011679ae2bcc880902d86bc106f37f7d9136f.zip
am e398d09a: am af75e48e: am 74577bed: Merge "Implement the heuristic for auto-commit."
* commit 'e398d09a50486d1b91ce109f4bd1a7529560c634': Implement the heuristic for auto-commit.
Diffstat (limited to 'native/jni/src/defines.h')
-rw-r--r--native/jni/src/defines.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h
index c920f64b4..742e388e4 100644
--- a/native/jni/src/defines.h
+++ b/native/jni/src/defines.h
@@ -298,9 +298,19 @@ static inline void prof_out(void) {
#define NOT_AN_INDEX (-1)
#define NOT_A_PROBABILITY (-1)
#define NOT_A_DICT_POS (S_INT_MIN)
+
// A special value to mean the first word confidence makes no sense in this case,
// e.g. this is not a multi-word suggestion.
-#define NOT_A_FIRST_WORD_CONFIDENCE (S_INT_MIN)
+#define NOT_A_FIRST_WORD_CONFIDENCE (S_INT_MAX)
+// How high the confidence needs to be for us to auto-commit. Arbitrary.
+// This needs to be the same as CONFIDENCE_FOR_AUTO_COMMIT in BinaryDictionary.java
+#define CONFIDENCE_FOR_AUTO_COMMIT (1000000)
+// 80% of the full confidence
+#define DISTANCE_WEIGHT_FOR_AUTO_COMMIT (80 * CONFIDENCE_FOR_AUTO_COMMIT / 100)
+// 100% of the full confidence
+#define LENGTH_WEIGHT_FOR_AUTO_COMMIT (CONFIDENCE_FOR_AUTO_COMMIT)
+// 80% of the full confidence
+#define SPACE_COUNT_WEIGHT_FOR_AUTO_COMMIT (80 * CONFIDENCE_FOR_AUTO_COMMIT / 100)
#define KEYCODE_SPACE ' '
#define KEYCODE_SINGLE_QUOTE '\''