blob: 535fb5402a8caca5d0ba92f71d96f894e72e70f7 [file] [log] [blame]
khenaidooac637102019-01-14 15:44:34 -05001// Copyright 2013 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package collate
6
7import "golang.org/x/text/internal/colltab"
8
9const blockSize = 64
10
11func getTable(t tableIndex) *colltab.Table {
12 return &colltab.Table{
13 Index: colltab.Trie{
14 Index0: mainLookup[:][blockSize*t.lookupOffset:],
15 Values0: mainValues[:][blockSize*t.valuesOffset:],
16 Index: mainLookup[:],
17 Values: mainValues[:],
18 },
19 ExpandElem: mainExpandElem[:],
20 ContractTries: colltab.ContractTrieSet(mainCTEntries[:]),
21 ContractElem: mainContractElem[:],
22 MaxContractLen: 18,
23 VariableTop: varTop,
24 }
25}
26
27// tableIndex holds information for constructing a table
28// for a certain locale based on the main table.
29type tableIndex struct {
30 lookupOffset uint32
31 valuesOffset uint32
32}