browser/components/translation/cld2/internal/debug.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/translation/cld2/internal/debug.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,58 @@
     1.4 +// Copyright 2013 Google Inc. All Rights Reserved.
     1.5 +//
     1.6 +// Licensed under the Apache License, Version 2.0 (the "License");
     1.7 +// you may not use this file except in compliance with the License.
     1.8 +// You may obtain a copy of the License at
     1.9 +//
    1.10 +//     http://www.apache.org/licenses/LICENSE-2.0
    1.11 +//
    1.12 +// Unless required by applicable law or agreed to in writing, software
    1.13 +// distributed under the License is distributed on an "AS IS" BASIS,
    1.14 +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    1.15 +// See the License for the specific language governing permissions and
    1.16 +// limitations under the License.
    1.17 +
    1.18 +//
    1.19 +// Author: dsites@google.com (Dick Sites)
    1.20 +//
    1.21 +// Produces debugging output for CLD2. See debug_empty.h for suppressing this.
    1.22 +
    1.23 +
    1.24 +#ifndef I18N_ENCODINGS_CLD2_INTERNAL_DEBUG_H_
    1.25 +#define I18N_ENCODINGS_CLD2_INTERNAL_DEBUG_H_
    1.26 +
    1.27 +#include <string>
    1.28 +#include "scoreonescriptspan.h"
    1.29 +
    1.30 +namespace CLD2 {
    1.31 +
    1.32 +// For showing one chunk
    1.33 +void CLD2_Debug(const char* text,
    1.34 +                int lo_offset,
    1.35 +                int hi_offset,
    1.36 +                bool more_to_come, bool score_cjk,
    1.37 +                const ScoringHitBuffer* hitbuffer,
    1.38 +                const ScoringContext* scoringcontext,
    1.39 +                const ChunkSpan* cspan,
    1.40 +                const ChunkSummary* chunksummary);
    1.41 +
    1.42 +// For showing all chunks
    1.43 +void CLD2_Debug2(const char* text,
    1.44 +                 bool more_to_come, bool score_cjk,
    1.45 +                 const ScoringHitBuffer* hitbuffer,
    1.46 +                 const ScoringContext* scoringcontext,
    1.47 +                 const SummaryBuffer* summarybuffer);
    1.48 +
    1.49 +std::string GetPlainEscapedText(const std::string& txt);
    1.50 +std::string GetHtmlEscapedText(const std::string& txt);
    1.51 +std::string GetColorHtmlEscapedText(Language lang, const std::string& txt);
    1.52 +std::string GetLangColorHtmlEscapedText(Language lang, const std::string& txt);
    1.53 +
    1.54 +void DumpResultChunkVector(FILE* f, const char* src,
    1.55 +                           ResultChunkVector* resultchunkvector);
    1.56 +
    1.57 +
    1.58 +}     // End namespace CLD2
    1.59 +
    1.60 +#endif  // I18N_ENCODINGS_CLD2_INTERNAL_DEBUG_H_
    1.61 +

mercurial