add a debug flag to evaluate the most probable string

Change-Id: I34dc08c14feb9cbc0304c1d0ff06922e3b65819d
main
Satoshi Kataoka 2013-04-10 11:45:12 +09:00
parent cdaee868a3
commit 8b3009ef48
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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) {