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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // Copyright 2013 Google Inc. All Rights Reserved.
michael@0 2 //
michael@0 3 // Licensed under the Apache License, Version 2.0 (the "License");
michael@0 4 // you may not use this file except in compliance with the License.
michael@0 5 // You may obtain a copy of the License at
michael@0 6 //
michael@0 7 // http://www.apache.org/licenses/LICENSE-2.0
michael@0 8 //
michael@0 9 // Unless required by applicable law or agreed to in writing, software
michael@0 10 // distributed under the License is distributed on an "AS IS" BASIS,
michael@0 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
michael@0 12 // See the License for the specific language governing permissions and
michael@0 13 // limitations under the License.
michael@0 14
michael@0 15 //
michael@0 16 // Author: dsites@google.com (Dick Sites)
michael@0 17 //
michael@0 18
michael@0 19
michael@0 20 #ifndef I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_
michael@0 21 #define I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_
michael@0 22
michael@0 23 #include "integral_types.h"
michael@0 24
michael@0 25 namespace CLD2 {
michael@0 26
michael@0 27 // Hash bucket for four-way associative lookup, indirect probabilities
michael@0 28 // 16 bytes per bucket, 4-byte entries
michael@0 29 typedef struct {
michael@0 30 uint32 keyvalue[4]; // Upper part of word is hash, lower is indirect prob
michael@0 31 } IndirectProbBucket4;
michael@0 32
michael@0 33
michael@0 34 // Expanded version December 2012.
michael@0 35 // Moves cutoff for 6-language vs. 3-language indirects
michael@0 36 // Has list of recognized lang-script combinations
michael@0 37 typedef struct {
michael@0 38 const IndirectProbBucket4* kCLDTable;
michael@0 39 // Each bucket has four entries, part
michael@0 40 // key and part indirect subscript
michael@0 41 const uint32* kCLDTableInd; // Each entry is three packed lang/prob
michael@0 42 uint32 kCLDTableSizeOne; // Indirect subscripts >= this: 2 entries
michael@0 43 uint32 kCLDTableSize; // Bucket count
michael@0 44 uint32 kCLDTableKeyMask; // Mask hash key
michael@0 45 uint32 kCLDTableBuildDate; // yyyymmdd
michael@0 46 const char* kRecognizedLangScripts; // Character string of lang-Scripts
michael@0 47 // recognized: "en-Latn az-Arab ..."
michael@0 48 // Single space delimiter, Random order
michael@0 49 } CLD2TableSummary;
michael@0 50
michael@0 51 } // End namespace CLD2
michael@0 52
michael@0 53 #endif // I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_
michael@0 54
michael@0 55

mercurial