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

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:47e206033fcf
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
19
20 #ifndef I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_
21 #define I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_
22
23 #include "integral_types.h"
24
25 namespace CLD2 {
26
27 // Hash bucket for four-way associative lookup, indirect probabilities
28 // 16 bytes per bucket, 4-byte entries
29 typedef struct {
30 uint32 keyvalue[4]; // Upper part of word is hash, lower is indirect prob
31 } IndirectProbBucket4;
32
33
34 // Expanded version December 2012.
35 // Moves cutoff for 6-language vs. 3-language indirects
36 // Has list of recognized lang-script combinations
37 typedef struct {
38 const IndirectProbBucket4* kCLDTable;
39 // Each bucket has four entries, part
40 // key and part indirect subscript
41 const uint32* kCLDTableInd; // Each entry is three packed lang/prob
42 uint32 kCLDTableSizeOne; // Indirect subscripts >= this: 2 entries
43 uint32 kCLDTableSize; // Bucket count
44 uint32 kCLDTableKeyMask; // Mask hash key
45 uint32 kCLDTableBuildDate; // yyyymmdd
46 const char* kRecognizedLangScripts; // Character string of lang-Scripts
47 // recognized: "en-Latn az-Arab ..."
48 // Single space delimiter, Random order
49 } CLD2TableSummary;
50
51 } // End namespace CLD2
52
53 #endif // I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_
54
55

mercurial