aboutsummaryrefslogtreecommitdiffstats
path: root/native/src/defines.h
diff options
context:
space:
mode:
authorsatok <satok@google.com>2012-01-16 00:20:06 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-01-16 00:20:06 -0800
commit53c4248c6f33891ec76cd0f5054c00eea2f7957c (patch)
treeb75b4042868fc705a056854d4b33fa9bad533c74 /native/src/defines.h
parent65b489cd76e8ae4898bf4788c013f245487cb1d7 (diff)
parent67e13976b78619ec7bc45b5377a9f5da2534cfd5 (diff)
downloadlatinime-53c4248c6f33891ec76cd0f5054c00eea2f7957c.tar.gz
latinime-53c4248c6f33891ec76cd0f5054c00eea2f7957c.tar.xz
latinime-53c4248c6f33891ec76cd0f5054c00eea2f7957c.zip
am 67e13976: Merge "Store suggestions for each input length for missing space algorithm etc."
* commit '67e13976b78619ec7bc45b5377a9f5da2534cfd5': Store suggestions for each input length for missing space algorithm etc.
Diffstat (limited to 'native/src/defines.h')
-rw-r--r--native/src/defines.h30
1 files changed, 16 insertions, 14 deletions
diff --git a/native/src/defines.h b/native/src/defines.h
index 01ef65678..48f92d86c 100644
--- a/native/src/defines.h
+++ b/native/src/defines.h
@@ -22,9 +22,23 @@
#include <cutils/log.h>
#define AKLOGE ALOGE
#define AKLOGI ALOGI
+
+#define DUMP_WORD(word, length) do { dumpWord(word, length); } while(0)
+
+static char charBuf[50];
+
+static void dumpWord(const unsigned short* word, const int length) {
+ for (int i = 0; i < length; ++i) {
+ charBuf[i] = word[i];
+ }
+ charBuf[length] = 0;
+ AKLOGI("[ %s ]", charBuf);
+}
+
#else
#define AKLOGE(fmt, ...)
#define AKLOGI(fmt, ...)
+#define DUMP_WORD(word, length)
#endif
#ifdef FLAG_DO_PROFILE
@@ -106,18 +120,6 @@ static void prof_out(void) {
#define DEBUG_CORRECTION_FREQ true
#define DEBUG_WORDS_PRIORITY_QUEUE true
-#define DUMP_WORD(word, length) do { dumpWord(word, length); } while(0)
-
-static char charBuf[50];
-
-static void dumpWord(const unsigned short* word, const int length) {
- for (int i = 0; i < length; ++i) {
- charBuf[i] = word[i];
- }
- charBuf[length] = 0;
- AKLOGI("[ %s ]", charBuf);
-}
-
#else // FLAG_DBG
#define DEBUG_DICT false
@@ -131,7 +133,6 @@ static void dumpWord(const unsigned short* word, const int length) {
#define DEBUG_CORRECTION_FREQ false
#define DEBUG_WORDS_PRIORITY_QUEUE false
-#define DUMP_WORD(word, length)
#endif // FLAG_DBG
@@ -207,7 +208,8 @@ static void dumpWord(const unsigned short* word, const int length) {
// Word limit for sub queues used in WordsPriorityQueuePool. Sub queues are temporary queues used
// for better performance.
-#define SUB_QUEUE_MAX_WORDS 5
+// Holds up to 1 candidate for each word
+#define SUB_QUEUE_MAX_WORDS 1
#define SUB_QUEUE_MAX_COUNT 10
#define MAX_DEPTH_MULTIPLIER 3