diff options
author | 2013-04-17 19:41:03 -0700 | |
---|---|---|
committer | 2013-04-17 19:41:03 -0700 | |
commit | d059451939630c93f8f2476c8ace4f17977ca019 (patch) | |
tree | 8694c6b21e8ebbaffc1ad89a340f1c2c0f0d6868 | |
parent | 24b39f16b2ebce48713733fa2cc5185475900c4c (diff) | |
parent | 4945b656eab084a99a4f60f5ed0f7748295ccb84 (diff) | |
download | latinime-d059451939630c93f8f2476c8ace4f17977ca019.tar.gz latinime-d059451939630c93f8f2476c8ace4f17977ca019.tar.xz latinime-d059451939630c93f8f2476c8ace4f17977ca019.zip |
am 4945b656: am 6c7d008e: Merge "add a debug flag to evaluate the most probable string"
* commit '4945b656eab084a99a4f60f5ed0f7748295ccb84':
add a debug flag to evaluate the most probable string
-rw-r--r-- | native/jni/src/defines.h | 2 | ||||
-rw-r--r-- | native/jni/src/suggest/core/suggest.cpp | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h index a45691261..a7b023a75 100644 --- a/native/jni/src/defines.h +++ b/native/jni/src/defines.h @@ -216,6 +216,7 @@ static inline void prof_out(void) { #define DEBUG_DOUBLE_LETTER false #define DEBUG_CACHE false #define DEBUG_DUMP_ERROR false +#define DEBUG_EVALUATE_MOST_PROBABLE_STRING false #ifdef FLAG_FULL_DBG #define DEBUG_GEO_FULL true @@ -241,6 +242,7 @@ static inline void prof_out(void) { #define DEBUG_DOUBLE_LETTER false #define DEBUG_CACHE false #define DEBUG_DUMP_ERROR false +#define DEBUG_EVALUATE_MOST_PROBABLE_STRING false #define DEBUG_GEO_FULL false diff --git a/native/jni/src/suggest/core/suggest.cpp b/native/jni/src/suggest/core/suggest.cpp index 63bb20004..67d351fa1 100644 --- a/native/jni/src/suggest/core/suggest.cpp +++ b/native/jni/src/suggest/core/suggest.cpp @@ -124,8 +124,12 @@ void Suggest::initializeSearch(DicTraverseSession *traverseSession, int commitPo */ int Suggest::outputSuggestions(DicTraverseSession *traverseSession, int *frequencies, int *outputCodePoints, int *spaceIndices, int *outputTypes) const { +#if DEBUG_EVALUATE_MOST_PROBABLE_STRING + const int terminalSize = 0; +#else const int terminalSize = min(MAX_RESULTS, static_cast<int>(traverseSession->getDicTraverseCache()->terminalSize())); +#endif DicNode terminals[MAX_RESULTS]; // Avoiding non-POD variable length array for (int index = terminalSize - 1; index >= 0; --index) { |