@@ -28,19 +28,6 @@ Score tau_size = 150;
2828// This has a direct influence on worst case scenario benchmark.
2929float miss_coeff = 0.75 ; // Max number missed consecutive hit = ceil(miss_coeff*query.length) + 5
3030
31- #define TRACE (...) trace_internal(__FUNCTION__, " (" , __LINE__, " )" , __VA_ARGS__)
32-
33- void trace_internal () {
34- std::cout << std::endl;
35- }
36-
37- template <typename Head, typename ... Args>
38- void trace_internal (const Head& head, const Args&... args )
39- {
40- std::cout << head << " " ;
41- trace_internal (args...);
42- }
43-
4431} // namepace
4532
4633struct AcronymResult {
@@ -128,14 +115,11 @@ Score computeScore(const Candidate &subject, const Candidate &subject_lw, const
128115 int m = subject.size ();
129116 int n = query.size ();
130117
131- TRACE (subject, subject_lw, query, query_lw);
132-
133118 // ----------------------------
134119 // Abbreviations sequence
135120
136121 auto acro = scoreAcronyms (subject, subject_lw, query, query_lw);
137122 auto acro_score = acro.score ;
138- TRACE (acro.score , acro.pos , acro.count );
139123
140124 // Whole query is abbreviation ?
141125 // => use that as score
@@ -148,7 +132,6 @@ Score computeScore(const Candidate &subject, const Candidate &subject_lw, const
148132
149133 auto pos = subject_lw.find (query_lw);
150134 if (pos != std::string::npos) {
151- TRACE (pos, n, m);
152135 return scoreExactMatch (subject, subject_lw, query, query_lw, pos, n, m);
153136 }
154137
@@ -166,7 +149,6 @@ Score computeScore(const Candidate &subject, const Candidate &subject_lw, const
166149 auto miss_budget = ceil (miss_coeff * n) + 5 ;
167150 auto miss_left = miss_budget;
168151 bool csc_should_rebuild = true ;
169- TRACE (sz, miss_budget, miss_left, miss_coeff);
170152
171153 // Fill with 0
172154 /*
@@ -252,7 +234,6 @@ Score computeScore(const Candidate &subject, const Candidate &subject_lw, const
252234
253235 // get hightest score so far
254236 auto score = score_row[n - 1 ];
255- TRACE (score, sz);
256237 return score * sz;
257238}
258239
@@ -303,7 +284,6 @@ Score scoreSize(Score n, Score m) {
303284}
304285
305286Score scoreExact (size_t n, size_t m, size_t quality, Score pos) {
306- TRACE (n, m, quality, pos);
307287 return 2 * n * ( wm * quality + scorePosition (pos) ) * scoreSize (n, m);
308288}
309289
@@ -402,8 +382,6 @@ Score scoreExactMatch(const Candidate &subject, const Candidate &subject_lw, con
402382
403383 // Test for word start
404384 bool start = isWordStart (pos, subject, subject_lw);
405- TRACE (query, query_lw);
406- TRACE (pos, n, m, start);
407385
408386 // Heuristic
409387 // If not a word start, test next occurrence
@@ -418,7 +396,6 @@ Score scoreExactMatch(const Candidate &subject, const Candidate &subject_lw, con
418396 if (start) pos = pos2;
419397 }
420398 }
421- TRACE (start, pos);
422399
423400 // Exact case bonus.
424401 int i = -1 ;
@@ -427,10 +404,8 @@ Score scoreExactMatch(const Candidate &subject, const Candidate &subject_lw, con
427404 if (query[i] == subject[pos + i])
428405 sameCase++;
429406 }
430- TRACE (sameCase);
431407
432408 int end = isWordEnd (pos + n - 1 , subject, subject_lw, m);
433- TRACE (end);
434409
435410 Score baseNameStart = 1 ;
436411 if (start && pos>0 && subject[pos-1 ]==' /' ) {
0 commit comments