|
1 // Copyright 2013 Google Inc. All Rights Reserved. |
|
2 // |
|
3 // Licensed under the Apache License, Version 2.0 (the "License"); |
|
4 // you may not use this file except in compliance with the License. |
|
5 // You may obtain a copy of the License at |
|
6 // |
|
7 // http://www.apache.org/licenses/LICENSE-2.0 |
|
8 // |
|
9 // Unless required by applicable law or agreed to in writing, software |
|
10 // distributed under the License is distributed on an "AS IS" BASIS, |
|
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
12 // See the License for the specific language governing permissions and |
|
13 // limitations under the License. |
|
14 |
|
15 // |
|
16 // Author: dsites@google.com (Dick Sites) |
|
17 // |
|
18 // Produces debugging output for CLD2. See debug_empty.h for suppressing this. |
|
19 |
|
20 |
|
21 #ifndef I18N_ENCODINGS_CLD2_INTERNAL_DEBUG_H_ |
|
22 #define I18N_ENCODINGS_CLD2_INTERNAL_DEBUG_H_ |
|
23 |
|
24 #include <string> |
|
25 #include "scoreonescriptspan.h" |
|
26 |
|
27 namespace CLD2 { |
|
28 |
|
29 // For showing one chunk |
|
30 void CLD2_Debug(const char* text, |
|
31 int lo_offset, |
|
32 int hi_offset, |
|
33 bool more_to_come, bool score_cjk, |
|
34 const ScoringHitBuffer* hitbuffer, |
|
35 const ScoringContext* scoringcontext, |
|
36 const ChunkSpan* cspan, |
|
37 const ChunkSummary* chunksummary); |
|
38 |
|
39 // For showing all chunks |
|
40 void CLD2_Debug2(const char* text, |
|
41 bool more_to_come, bool score_cjk, |
|
42 const ScoringHitBuffer* hitbuffer, |
|
43 const ScoringContext* scoringcontext, |
|
44 const SummaryBuffer* summarybuffer); |
|
45 |
|
46 std::string GetPlainEscapedText(const std::string& txt); |
|
47 std::string GetHtmlEscapedText(const std::string& txt); |
|
48 std::string GetColorHtmlEscapedText(Language lang, const std::string& txt); |
|
49 std::string GetLangColorHtmlEscapedText(Language lang, const std::string& txt); |
|
50 |
|
51 void DumpResultChunkVector(FILE* f, const char* src, |
|
52 ResultChunkVector* resultchunkvector); |
|
53 |
|
54 |
|
55 } // End namespace CLD2 |
|
56 |
|
57 #endif // I18N_ENCODINGS_CLD2_INTERNAL_DEBUG_H_ |
|
58 |