github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/text/collate/index.go (about) 1 // 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 5 package collate 6 7 // tableIndex holds information for constructing a table 8 // for a certain locale based on the main table. 9 type tableIndex struct { 10 lookupOffset uint32 11 valuesOffset uint32 12 } 13 14 func (t tableIndex) TrieIndex() []uint16 { 15 return mainLookup[:] 16 } 17 18 func (t tableIndex) TrieValues() []uint32 { 19 return mainValues[:] 20 } 21 22 func (t tableIndex) FirstBlockOffsets() (lookup, value uint16) { 23 return uint16(t.lookupOffset), uint16(t.valuesOffset) 24 } 25 26 func (t tableIndex) ExpandElems() []uint32 { 27 return mainExpandElem[:] 28 } 29 30 func (t tableIndex) ContractTries() []struct{ l, h, n, i uint8 } { 31 return mainCTEntries[:] 32 } 33 34 func (t tableIndex) ContractElems() []uint32 { 35 return mainContractElem[:] 36 } 37 38 func (t tableIndex) MaxContractLen() int { 39 return 18 // TODO: generate 40 } 41 42 func (t tableIndex) VariableTop() uint32 { 43 return varTop 44 }