Library
Module
Module type
Parameter
Class
Class type
module Collation_mapping : sig ... end
val register_collation_mapping :
?lang:Iso639.Lang.t ->
Collation_mapping.t ->
unit
register_collation_mapping ~lang m
registers m
to be used for collating string representing text in the language lang
.
register_collation_mapping m
registers m
to be used as a fall-back mapping when collate
is called without an explicit mapping and either the language is unspecified or not mapping has been registered for the specified language. A good fall-back is provided by linking against the confero.ducet
sublibrary.
This function updates global state and should only be used during program initialization by libraries providing collation mappings or by the main entry point of the application.
val infer_collation_mapping :
?lang:Iso639.Lang.t ->
?mapping:Collation_mapping.t ->
unit ->
Collation_mapping.t
infer_collation_mapping ?lang ?mapping ()
returns the mapping which would have been used by collate
given the same named arguments.
module Collation_element : sig ... end
Vectors of weights derived from an input string and a collation element mapping.
module Sort_key : sig ... end
A compact representations of a collation elements as private strings whose lexicographic byte order represent the collation order.
val collate :
?encoding:Uutf.encoding ->
?lang:Iso639.Lang.t ->
?mapping:Collation_mapping.t ->
?total:bool ->
string ->
string ->
int
collate ?encoding ?lang ?mapping s1 s2
returns a negative integer, zero, or a positive integer when s1
is ordered before s2
, s1
and s2
are unordered, or s1
is ordered after s2
, respectively, according to a collation mapping inferred from mapping
and lang
as follows:
lang
is specified and a mapping has been registered for lang
with register_collation_mapping
then it is used, elsemapping
is specified then it is used, elseregister_collation_mapping
then it is used, elsePass ~total:true
when a total order is required, e.g. when using it as the implementation of Map.OrderedType.compare
or Set.OrderedType.compare
.