MediaWiki
REL1_19
|
Public Member Functions | |
__construct ($locale) | |
findLowerBound ($valueCallback, $valueCount, $comparisonCallback, $target) | |
Do a binary search, and return the index of the largest item that sorts less than or equal to the target value. | |
getFirstLetter ($string) | |
Given a string, return the logical "first letter" to be used for grouping on category pages and so on. | |
getFirstLetterCount () | |
getFirstLetterData () | |
getLetterByIndex ($index) | |
getPrimarySortKey ($string) | |
getSortKey ($string) | |
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting. | |
getSortKeyByLetterIndex ($index) | |
Static Public Member Functions | |
static | isCjk ($codepoint) |
Public Attributes | |
$firstLetterData | |
$locale | |
$mainCollator | |
$primaryCollator | |
const | RECORD_LENGTH = 14 |
Static Public Attributes | |
static | $cjkBlocks |
Unified CJK blocks. |
Definition at line 128 of file Collation.php.
IcuCollation::__construct | ( | $ | locale | ) |
Definition at line 161 of file Collation.php.
References $locale.
IcuCollation::findLowerBound | ( | $ | valueCallback, |
$ | valueCount, | ||
$ | comparisonCallback, | ||
$ | target | ||
) |
Do a binary search, and return the index of the largest item that sorts less than or equal to the target value.
$valueCallback | array A function to call to get the value with a given array index. |
$valueCount | int The number of items accessible via $valueCallback, indexed from 0 to $valueCount - 1 |
$comparisonCallback | array A callback to compare two values, returning -1, 0 or 1 in the style of strcmp(). |
$target | string The target value to find. |
Definition at line 317 of file Collation.php.
Referenced by getFirstLetter().
IcuCollation::getFirstLetter | ( | $ | string | ) |
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.
string | $string | UTF-8 string |
Reimplemented from Collation.
Definition at line 193 of file Collation.php.
References findLowerBound(), getFirstLetterCount(), getLetterByIndex(), getPrimarySortKey(), and utf8ToCodepoint().
Definition at line 295 of file Collation.php.
References getFirstLetterData().
Referenced by getFirstLetter().
Definition at line 223 of file Collation.php.
References getPrimarySortKey(), wfGetCache(), wfGetPrecompiledData(), and wfMemcKey().
Referenced by getFirstLetterCount(), getLetterByIndex(), and getSortKeyByLetterIndex().
IcuCollation::getLetterByIndex | ( | $ | index | ) |
Definition at line 281 of file Collation.php.
References getFirstLetterData().
Referenced by getFirstLetter().
IcuCollation::getPrimarySortKey | ( | $ | string | ) |
Definition at line 186 of file Collation.php.
References wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by getFirstLetter(), and getFirstLetterData().
IcuCollation::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).
string | $string | UTF-8 string |
Reimplemented from Collation.
Definition at line 176 of file Collation.php.
References wfRestoreWarnings(), and wfSuppressWarnings().
IcuCollation::getSortKeyByLetterIndex | ( | $ | index | ) |
Definition at line 288 of file Collation.php.
References getFirstLetterData().
static IcuCollation::isCjk | ( | $ | codepoint | ) | [static] |
Definition at line 342 of file Collation.php.
Referenced by GenerateCollationData\charCallback().
IcuCollation::$cjkBlocks [static] |
array( array( 0x2E80, 0x2EFF ), array( 0x2F00, 0x2FDF ), array( 0x2FF0, 0x2FFF ), array( 0x3000, 0x303F ), array( 0x31C0, 0x31EF ), array( 0x3200, 0x32FF ), array( 0x3300, 0x33FF ), array( 0x3400, 0x4DBF ), array( 0x4E00, 0x9FFF ), array( 0xF900, 0xFAFF ), array( 0xFE30, 0xFE4F ), array( 0x20000, 0x2A6DF ), array( 0x2A700, 0x2B73F ), array( 0x2B740, 0x2B81F ), array( 0x2F800, 0x2FA1F ), )
Unified CJK blocks.
The same definition of a CJK block must be used for both Collation and generateCollationData.php. These blocks are omitted from the first letter data, as an optimisation measure and because the default UCA table is pretty useless for sorting Chinese text anyway. Japanese and Korean blocks are not included here, because they are smaller and more useful.
Definition at line 141 of file Collation.php.
IcuCollation::$firstLetterData |
Definition at line 130 of file Collation.php.
IcuCollation::$locale |
Definition at line 129 of file Collation.php.
Referenced by __construct().
IcuCollation::$mainCollator |
Definition at line 129 of file Collation.php.
IcuCollation::$primaryCollator |
Definition at line 129 of file Collation.php.
const IcuCollation::RECORD_LENGTH = 14 |
Definition at line 159 of file Collation.php.