Home | History | Annotate | Download | only in compact_lang_det
      1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "encodings/compact_lang_det/cldutil_dbg.h"
      6 //#include <string>
      7 
      8 //#include "base/logging.h"
      9 //#include "i18n/encodings/compact_lang_det/generated/compact_lang_det_generated_meanscore.h"
     10 //#include "i18n/encodings/compact_lang_det/utf8propletterscriptnum.h"
     11 //#include "third_party/utf/utf.h"            // for UTFmax
     12 //#include "util/utf8/unicodeprops.h"
     13 //#include "util/utf8/unilib.h"
     14 //#include "util/utf8/utf8statetable.h"
     15 #include "encodings/compact_lang_det/win/cld_commandlineflags.h"
     16 
     17 DEFINE_bool(dbgscore, false, "Print picture of score calculation");
     18 DEFINE_bool(dbglookup, false, "Print every quad/uni lookup in score calc");
     19 DEFINE_bool(dbgreli, false, "Print reliability in score calc");
     20 
     21 namespace cld {
     22 
     23 
     24 //------------------------------------------------------------------------------
     25 // Debugging. Not thread safe
     26 // This is the empty version -- routines return immediately
     27 //------------------------------------------------------------------------------
     28 
     29   void DbgScoreInit(const char* src, int len) {};
     30 
     31   // Return a 3-byte + NUL code for language
     32   void DbgLangName3(Language lang, char* temp) {};
     33 
     34   // Show all per-language totals
     35   void DbgScoreState() {};
     36 
     37   void DbgScoreTop(const char* src, int srclen, Tote* chunk_tote) {};
     38 
     39   void DbgScoreFlush() {};
     40 
     41   // Allow additional scoring debug output
     42   void DbgScoreRecord(const char* src, uint32 probs, int len) {};
     43 
     44   void DbgScoreRecordUni(const char* src, int propval, int len) {};
     45 
     46   // Debug print language name(s)
     47   void PrintLang(FILE* f, const Tote* chunk_tote,
     48                  const Language cur_lang, const bool cur_unreliable,
     49                  Language prior_lang, bool prior_unreliable) {};
     50 
     51   // Debug print language name(s)
     52   void PrintLang2(FILE* f,
     53                   const Language lang1, const Language lang2, bool diff_prior) {};
     54 
     55   // Debug print text span
     56   void PrintText(FILE* f, Language cur_lang, const string& str) {};
     57 
     58   // Debug print text span with speculative language
     59   void PrintTextSpeculative(FILE* f, Language cur_lang, const string& str) {};
     60 
     61   // Debug print ignored text span
     62   void PrintSkippedText(FILE* f, const string& str) {};
     63 
     64   void DbgProbsToStderr(uint32 probs) {};
     65   void DbgUniTermToStderr(int propval, const uint8* usrc, int len) {};
     66   // No pre/post space
     67   void DbgBiTermToStderr(uint32 bihash, uint32 probs,
     68                           const char* src, int len) {};
     69   void DbgQuadTermToStderr(uint32 quadhash, uint32 probs,
     70                           const char* src, int len) {};
     71   void DbgWordTermToStderr(uint64 wordhash, uint32 probs,
     72                           const char* src, int len) {};
     73 
     74 
     75 }       // End namespace cld
     76 
     77