MediaWiki
master
|
Public Member Functions | |
__construct ($locale) | |
getFirstLetter ($string) | |
getFirstLetterCount () | |
getFirstLetterData () | |
getLetterByIndex ($index) | |
getPrimarySortKey ($string) | |
getSortKey ($string) | |
getSortKeyByLetterIndex ($index) | |
Public Member Functions inherited from Collation | |
getFirstLetter ($string) | |
Given a string, return the logical "first letter" to be used for grouping on category pages and so on. More... | |
getSortKey ($string) | |
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting. More... | |
Static Public Member Functions | |
static | getICUVersion () |
Return the version of ICU library used by PHP's intl extension, or false when the extension is not installed of the version can't be determined. More... | |
static | getUnicodeVersionForICU () |
Return the version of Unicode appropriate for the version of ICU library currently in use, or false when it can't be determined. More... | |
static | isCjk ($codepoint) |
Test if a code point is a CJK (Chinese, Japanese, Korean) character. More... | |
Static Public Member Functions inherited from Collation | |
static | factory ($collationName) |
static | singleton () |
Public Attributes | |
const | FIRST_LETTER_VERSION = 2 |
static const | RECORD_LENGTH = 14 |
Protected Attributes | |
Language | $digitTransformLanguage |
Private Member Functions | |
fetchFirstLetterData () | |
Private Attributes | |
array | $firstLetterData |
string | $locale |
Collator | $mainCollator |
Collator | $primaryCollator |
boolean | $useNumericCollation = false |
Static Private Attributes | |
static | $cjkBlocks |
Unified CJK blocks. More... | |
static | $tailoringFirstLetters |
Additional characters (or character groups) to be considered separate letters for given languages, or to be removed from the list of such letters (denoted by keys starting with '-'). More... | |
Definition at line 24 of file IcuCollation.php.
IcuCollation::__construct | ( | $locale | ) |
Definition at line 185 of file IcuCollation.php.
References $locale, create, and Language\factory().
|
private |
MWException |
Definition at line 288 of file IcuCollation.php.
References $value, as, getPrimarySortKey(), wfDebug(), and wfGetPrecompiledData().
Referenced by getFirstLetterData().
IcuCollation::getFirstLetter | ( | $string | ) |
Definition at line 222 of file IcuCollation.php.
References ArrayUtils\findLowerBound(), getFirstLetterCount(), getLetterByIndex(), getPrimarySortKey(), utf8ToCodepoint(), and wfMessage().
IcuCollation::getFirstLetterCount | ( | ) |
Definition at line 431 of file IcuCollation.php.
References getFirstLetterData().
Referenced by getFirstLetter().
IcuCollation::getFirstLetterData | ( | ) |
Definition at line 267 of file IcuCollation.php.
References $cache, $firstLetterData, CACHE_ANYTHING, fetchFirstLetterData(), and ObjectCache\getLocalServerInstance().
Referenced by getFirstLetterCount(), getLetterByIndex(), and getSortKeyByLetterIndex().
|
static |
Return the version of ICU library used by PHP's intl extension, or false when the extension is not installed of the version can't be determined.
The constant INTL_ICU_VERSION this function refers to isn't really documented. It is available since PHP 5.3.7 (see PHP bug 54561). This function will return false on older PHPs.
Definition at line 460 of file IcuCollation.php.
Referenced by GenerateCollationData\execute(), getUnicodeVersionForICU(), and SpecialVersion\softwareInformation().
IcuCollation::getLetterByIndex | ( | $index | ) |
Definition at line 417 of file IcuCollation.php.
References getFirstLetterData().
Referenced by getFirstLetter().
IcuCollation::getPrimarySortKey | ( | $string | ) |
Definition at line 218 of file IcuCollation.php.
Referenced by fetchFirstLetterData(), and getFirstLetter().
IcuCollation::getSortKey | ( | $string | ) |
Definition at line 214 of file IcuCollation.php.
IcuCollation::getSortKeyByLetterIndex | ( | $index | ) |
|
static |
Return the version of Unicode appropriate for the version of ICU library currently in use, or false when it can't be determined.
Definition at line 471 of file IcuCollation.php.
References getICUVersion().
Referenced by GenerateCollationData\execute().
|
static |
Test if a code point is a CJK (Chinese, Japanese, Korean) character.
Definition at line 439 of file IcuCollation.php.
References as.
Referenced by GenerateCollationData\charCallback().
|
staticprivate |
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 54 of file IcuCollation.php.
|
protected |
Definition at line 37 of file IcuCollation.php.
|
private |
Definition at line 43 of file IcuCollation.php.
Referenced by getFirstLetterData().
|
private |
Definition at line 34 of file IcuCollation.php.
Referenced by __construct().
|
private |
Definition at line 31 of file IcuCollation.php.
|
private |
Definition at line 28 of file IcuCollation.php.
|
staticprivate |
Additional characters (or character groups) to be considered separate letters for given languages, or to be removed from the list of such letters (denoted by keys starting with '-').
These are additions to (or subtractions from) the data stored in the first-letters-root.ser file (which among others includes full basic latin, cyrillic and greek alphabets).
"Separate letter" is a letter that would have a separate heading/section for it in a dictionary or a phone book in this language. This data isn't used for sorting (the ICU library handles that), only for deciding which characters (or character groups) to use as headings.
Initially generated based on the primary level of Unicode collation tailorings available at http://developer.mimer.com/charts/tailorings.htm , later modified.
Empty arrays are intended; this signifies that the data for the language is available and that there are, in fact, no additional letters to consider.
Definition at line 93 of file IcuCollation.php.
Definition at line 40 of file IcuCollation.php.
const IcuCollation::FIRST_LETTER_VERSION = 2 |
Definition at line 25 of file IcuCollation.php.
const IcuCollation::RECORD_LENGTH = 14 |
Definition at line 183 of file IcuCollation.php.