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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/translation/cld2/internal/cld2tablesummary.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     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 +
    1.22 +
    1.23 +#ifndef I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_
    1.24 +#define I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_
    1.25 +
    1.26 +#include "integral_types.h"
    1.27 +
    1.28 +namespace CLD2 {
    1.29 +
    1.30 +// Hash bucket for four-way associative lookup, indirect probabilities
    1.31 +// 16 bytes per bucket, 4-byte entries
    1.32 +typedef struct {
    1.33 +  uint32 keyvalue[4];   // Upper part of word is hash, lower is indirect prob
    1.34 +} IndirectProbBucket4;
    1.35 +
    1.36 +
    1.37 +// Expanded version December 2012.
    1.38 +// Moves cutoff for 6-language vs. 3-language indirects
    1.39 +// Has list of recognized lang-script combinations
    1.40 +typedef struct {
    1.41 +  const IndirectProbBucket4* kCLDTable;
    1.42 +                                      // Each bucket has four entries, part
    1.43 +                                      //  key and part indirect subscript
    1.44 +  const uint32* kCLDTableInd;         // Each entry is three packed lang/prob
    1.45 +  uint32 kCLDTableSizeOne;            // Indirect subscripts >= this: 2 entries
    1.46 +  uint32 kCLDTableSize;               // Bucket count
    1.47 +  uint32 kCLDTableKeyMask;            // Mask hash key
    1.48 +  uint32 kCLDTableBuildDate;          // yyyymmdd
    1.49 +  const char* kRecognizedLangScripts; // Character string of lang-Scripts
    1.50 +                                      //  recognized: "en-Latn az-Arab ..."
    1.51 +                                      //  Single space delimiter, Random order
    1.52 +} CLD2TableSummary;
    1.53 +
    1.54 +}       // End namespace CLD2
    1.55 +
    1.56 +#endif  // I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_
    1.57 +
    1.58 +

mercurial