class Collation
Encapsulates how strings are sorted
1 | Methods |
1.1 | Method set |
1.2 | method primary |
1.3 | method secondary |
1.4 | method tertiary |
1.5 | method quaternary |
2 | Type Graph |
Collation
is the class that allows proper sorting, taking into account all Unicode characteristics. It's the class the object $*COLLATION
is instantiated to, and thus includes collation levels, that is, what kind of features should be looked up when comparing two strings and in which order.
Methods
Method set
Defined as:
method set (Int : = 1,Int : = 1,Int : = 1,Int : = 1)
Sets if the different levels should be used in ascending or descending order, or if they are going to be ignored (when set to 0).
my = Collation.new;say 'a' coll 'z'; # OUTPUT: «Less».set(:primary(-1));say 'a' coll 'z'; # OUTPUT: «More»
method primary
Defined as:
method primary
Returns the state of the primary collation level.
method secondary
Defined as:
method secondary
Returns the state of the secondary collation level.
method tertiary
Defined as:
method tertiary
Returns the state of the tertiary collation level.
method quaternary
Defined as:
method quaternary
Returns the state of the quaternary collation level.