Skip to content
Snippets Groups Projects
Commit 6c7d008e authored by Satoshi Kataoka's avatar Satoshi Kataoka Committed by Android (Google) Code Review
Browse files

Merge "add a debug flag to evaluate the most probable string"

parents 6d0027a4 8b3009ef
No related branches found
No related tags found
No related merge requests found
...@@ -216,6 +216,7 @@ static inline void prof_out(void) { ...@@ -216,6 +216,7 @@ static inline void prof_out(void) {
#define DEBUG_DOUBLE_LETTER false #define DEBUG_DOUBLE_LETTER false
#define DEBUG_CACHE false #define DEBUG_CACHE false
#define DEBUG_DUMP_ERROR false #define DEBUG_DUMP_ERROR false
#define DEBUG_EVALUATE_MOST_PROBABLE_STRING false
#ifdef FLAG_FULL_DBG #ifdef FLAG_FULL_DBG
#define DEBUG_GEO_FULL true #define DEBUG_GEO_FULL true
...@@ -241,6 +242,7 @@ static inline void prof_out(void) { ...@@ -241,6 +242,7 @@ static inline void prof_out(void) {
#define DEBUG_DOUBLE_LETTER false #define DEBUG_DOUBLE_LETTER false
#define DEBUG_CACHE false #define DEBUG_CACHE false
#define DEBUG_DUMP_ERROR false #define DEBUG_DUMP_ERROR false
#define DEBUG_EVALUATE_MOST_PROBABLE_STRING false
#define DEBUG_GEO_FULL false #define DEBUG_GEO_FULL false
......
...@@ -124,8 +124,12 @@ void Suggest::initializeSearch(DicTraverseSession *traverseSession, int commitPo ...@@ -124,8 +124,12 @@ void Suggest::initializeSearch(DicTraverseSession *traverseSession, int commitPo
*/ */
int Suggest::outputSuggestions(DicTraverseSession *traverseSession, int *frequencies, int Suggest::outputSuggestions(DicTraverseSession *traverseSession, int *frequencies,
int *outputCodePoints, int *spaceIndices, int *outputTypes) const { int *outputCodePoints, int *spaceIndices, int *outputTypes) const {
#if DEBUG_EVALUATE_MOST_PROBABLE_STRING
const int terminalSize = 0;
#else
const int terminalSize = min(MAX_RESULTS, const int terminalSize = min(MAX_RESULTS,
static_cast<int>(traverseSession->getDicTraverseCache()->terminalSize())); static_cast<int>(traverseSession->getDicTraverseCache()->terminalSize()));
#endif
DicNode terminals[MAX_RESULTS]; // Avoiding non-POD variable length array DicNode terminals[MAX_RESULTS]; // Avoiding non-POD variable length array
for (int index = terminalSize - 1; index >= 0; --index) { for (int index = terminalSize - 1; index >= 0; --index) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment