switch( $collationName ) {
case 'uppercase':
return new UppercaseCollation;
- case 'uppercase-sv':
- return new UppercaseSvCollation;
case 'identity':
return new IdentityCollation;
case 'uca-default':
}
}
-/**
- * Like UppercaseCollation but swaps Ä and Æ.
- *
- * This provides an ordering suitable for Swedish.
- * @author Lejonel
- */
-class UppercaseSvCollation extends UppercaseCollation {
-
- /* Unicode code point order is ÄÅÆÖ, Swedish order is ÅÄÖ and Æ is often sorted as Ä.
- * Replacing Ä for Æ should give a better collation. */
- function getSortKey( $string ) {
- $uppercase = $this->lang->uc( $string );
- return strtr( $uppercase, array( 'Ä' => 'Æ', 'Æ' => 'Ä' ) );
- }
-}
-
/**
* Collation class that's essentially a no-op.
*
}
}
-
class IcuCollation extends Collation {
var $primaryCollator, $mainCollator, $locale;
var $firstLetterData;
);
/**
- * Additional characters (or character groups) to be considered first-letters
+ * Additional characters (or character groups) to be considered separate
+ * letters for given languages, compared to 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.
*
- * Generated based on the primary level of Unicode collation tailorings
- * available at http://developer.mimer.com/charts/tailorings.htm .
+ * 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.
*/
static $tailoringFirstLetters = array(
// Verified by native speakers
- 'pl' => array( "Ą", "Ć", "Ę", "Ł", "Ń", "Ó", "Ś", "Ź", "Ż" ),
+ 'be' => array( "Ё" ),
+ 'be-tarask' => array( "Ё" ),
'fi' => array( "Å", "Ä", "Ö" ),
+ 'pl' => array( "Ą", "Ć", "Ę", "Ł", "Ń", "Ó", "Ś", "Ź", "Ż" ),
+ 'ru' => array(),
// Not verified, but likely correct
'af' => array(),
'ast' => array( "CH", "LL", "Ñ" ),
'az' => array( "Ç", "Ə", "Ğ", "İ", "Ö", "Ş", "Ü" ),
- 'be' => array( "Ё" ),
'bg' => array(),
'br' => array( "CH", "C'H" ),
'bs' => array( "Č", "Ć", "DŽ", "Đ", "LJ", "NJ", "Š", "Ž" ),
'pt' => array(),
'rm' => array(),
'ro' => array( "Ă", "Â", "Î", "Ş", "Ţ" ),
- 'ru' => array(),
'rup' => array( "Ă", "Â", "Î", "Ľ", "Ń", "Ş", "Ţ" ),
'sco' => array(),
'sk' => array( "Ä", "Č", "CH", "Ô", "Š", "Ž" ),
'sr' => array(),
'sv' => array( "Å", "Ä", "Ö" ),
'tk' => array( "Ç", "Ä", "Ž", "Ň", "Ö", "Ş", "Ü", "Ý" ),
- 'tl' => array( "Ñ", "NG" ), /* 'fil' in the data source */
+ 'tl' => array( "Ñ", "NG" ),
'tr' => array( "Ç", "Ğ", "İ", "Ö", "Ş", "Ü" ),
'tt' => array( "Ә", "Ө", "Ү", "Җ", "Ң", "Һ" ),
'uk' => array( "Ґ", "Ь" ),