import "golang.org/x/text/internal/colltab"
Package colltab contains functionality related to collation tables. It is only to be used by the collate and search packages.
colltab.go contract.go iter.go
MatchLang finds the index of t in tags, using a matching algorithm used for collation and search. tags[0] must be language.Und, the remaining tags should be sorted alphabetically.
Language matching for collation and search is different from the matching defined by language.Matcher: the (inferred) base language must be an exact match for the relevant fields. For example, "gsw" should not match "de". Also the parent relation is different, as a parent may have a different script. So usually the parent of zh-Hant is und, whereas for MatchLang it is zh.
type Iter struct { Weighter colltab.Weighter Elems []colltab.Elem // N is the number of elements in Elems that will not be reordered on // subsequent iterations, N <= len(Elems). N int // contains filtered or unexported fields }
An Iter incrementally converts chunks of the input text to collation elements, while ensuring that the collation elements are in normalized order (that is, they are in the order as if the input text were normalized first).
Discard removes the collation elements up to N.
End returns the end position of the input text for which Next has returned results.
Len returns the length of the input text.
Next appends Elems to the internal array. On each iteration, it will either add starters or modifiers. In the majority of cases, an Elem with a primary value > 0 will have a CCC of 0. The CCC values of collation elements are also used to detect if the input string was not normalized and to adjust the result accordingly.
Reset sets the position in the current input text to p and discards any results obtained so far.
SetInput resets i to input s.
SetInputString resets i to input s.
Package colltab imports 4 packages (graph) and is imported by 2 packages. Updated about 7 hours ago. Refresh now. Tools for package owners.