MediaWiki  REL1_24
CollationEt Class Reference

Workaround for incorrect collation of Estonian language ('et') in ICU (bug 54168). More...

Inheritance diagram for CollationEt:
Collaboration diagram for CollationEt:

List of all members.

Public Member Functions

 __construct ()
 getFirstLetter ($string)
 Given a string, return the logical "first letter" to be used for grouping on category pages and so on.
 getSortKey ($string)
 Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.

Static Private Member Functions

static mangle ($string)
static unmangle ($string)

Detailed Description

Workaround for incorrect collation of Estonian language ('et') in ICU (bug 54168).

'W' and 'V' should not be considered the same letter for the purposes of collation in modern Estonian. We work around this by replacing 'W' and 'w' with 'ᴡ' U+1D21 'LATIN LETTER SMALL CAPITAL W' for sortkey generation, which is collated like 'W' and is not tailored to have the same primary weight as 'V' in Estonian.

Definition at line 611 of file Collation.php.


Constructor & Destructor Documentation

Definition at line 612 of file Collation.php.

Referenced by mangle().


Member Function Documentation

Given a string, return the logical "first letter" to be used for grouping on category pages and so on.

This has to be coordinated carefully with convertToSortkey(), or else the sorted list might jump back and forth between the same "initial letters" or other pathological behavior. For instance, if you just return the first character, but "a" sorts the same as "A" based on getSortKey(), then you might get a list like

== A == * [[Aardvark]]

== a == * [[antelope]]

== A == * [[Ape]]

etc., assuming for the sake of argument that $wgCapitalLinks is false.

Parameters:
string$stringUTF-8 string
Returns:
string UTF-8 string corresponding to the first letter of input

Reimplemented from IcuCollation.

Definition at line 637 of file Collation.php.

References getSortKey().

CollationEt::getSortKey ( string)

Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.

A binary sort according to the sortkeys corresponds to a logical sort of the corresponding strings. Current code expects that a line feed character should sort before all others, but has no other particular expectations (and that one can be changed if necessary).

Parameters:
string$stringUTF-8 string
Returns:
string Binary sortkey

Reimplemented from IcuCollation.

Definition at line 633 of file Collation.php.

Referenced by getFirstLetter().

static CollationEt::mangle ( string) [static, private]

Definition at line 616 of file Collation.php.

References __construct(), and array().

static CollationEt::unmangle ( string) [static, private]

Definition at line 624 of file Collation.php.


The documentation for this class was generated from the following file: