index.go 869 B

1234567891011121314151617181920212223242526272829303132
  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. package collate
  5. import "golang.org/x/text/internal/colltab"
  6. const blockSize = 64
  7. func getTable(t tableIndex) *colltab.Table {
  8. return &colltab.Table{
  9. Index: colltab.Trie{
  10. Index0: mainLookup[:][blockSize*t.lookupOffset:],
  11. Values0: mainValues[:][blockSize*t.valuesOffset:],
  12. Index: mainLookup[:],
  13. Values: mainValues[:],
  14. },
  15. ExpandElem: mainExpandElem[:],
  16. ContractTries: colltab.ContractTrieSet(mainCTEntries[:]),
  17. ContractElem: mainContractElem[:],
  18. MaxContractLen: 18,
  19. VariableTop: varTop,
  20. }
  21. }
  22. // tableIndex holds information for constructing a table
  23. // for a certain locale based on the main table.
  24. type tableIndex struct {
  25. lookupOffset uint32
  26. valuesOffset uint32
  27. }