]> Cypherpunks repositories - gostls13.git/commit
exp/locale/collate: preparation for adding Search API. Also changed the collate API
authorMarcel van Lohuizen <mpvl@golang.org>
Wed, 23 Jan 2013 13:15:51 +0000 (14:15 +0100)
committerMarcel van Lohuizen <mpvl@golang.org>
Wed, 23 Jan 2013 13:15:51 +0000 (14:15 +0100)
commitf86ae990e859e026475380f0a1e0c86203d7a0d5
tree86235c2cc61f50e5662f3ba117ddfbc4d8592707
parent7f0d1652a46df1d15d7e80fb34f88b5ebb4ff5f6
exp/locale/collate: preparation for adding Search API. Also changed the collate API
further to how (I believe) it will end up being.
It is nicer to separate search from sorting functionality. Collation needs tables that
are not needed by search and vice-versa.  The common functionality is separated out
in the Weigher interface.  As this interface is very low-level, it will be moved to
a sub package (colltab) in a next CL.
The types that will move to this package are Weigher, Elem, and Level.  The addition
of Elem allows for removing some of the duplicate code between collate and collate/build.
This CL also introduces some stubs for a higher-level API for options. The default
proposed options are quite complex and require the user to have a decent understanding
of Unicode collation.  The new options hide a lot of the complexity.

R=rsc
CC=golang-dev
https://golang.org/cl/7058051
src/pkg/exp/locale/collate/build/builder.go
src/pkg/exp/locale/collate/build/table.go
src/pkg/exp/locale/collate/colelem.go
src/pkg/exp/locale/collate/colelem_test.go
src/pkg/exp/locale/collate/collate.go
src/pkg/exp/locale/collate/colltab.go [new file with mode: 0644]
src/pkg/exp/locale/collate/export.go
src/pkg/exp/locale/collate/export_test.go
src/pkg/exp/locale/collate/table.go
src/pkg/exp/locale/collate/tables.go
src/pkg/exp/locale/collate/trie.go