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.
5 package colltab // import "golang.org/x/text/internal/colltab"
7 // A Weighter can be used as a source for Collator and Searcher.
8 type Weighter interface {
9 // Start finds the start of the segment that includes position p.
10 Start(p int, b []byte) int
12 // StartString finds the start of the segment that includes position p.
13 StartString(p int, s string) int
15 // AppendNext appends Elems to buf corresponding to the longest match
16 // of a single character or contraction from the start of s.
17 // It returns the new buf and the number of bytes consumed.
18 AppendNext(buf []Elem, s []byte) (ce []Elem, n int)
20 // AppendNextString appends Elems to buf corresponding to the longest match
21 // of a single character or contraction from the start of s.
22 // It returns the new buf and the number of bytes consumed.
23 AppendNextString(buf []Elem, s string) (ce []Elem, n int)
25 // Domain returns a slice of all single characters and contractions for which
26 // collation elements are defined in this table.
29 // Top returns the highest variable primary value.