IcuCollation::$tailoringFirstLetters: implement letter removal
authorMatmaRex <matma.rex@gmail.com>
Mon, 11 Mar 2013 21:24:09 +0000 (22:24 +0100)
committerMatmaRex <matma.rex@gmail.com>
Mon, 11 Mar 2013 21:24:30 +0000 (22:24 +0100)
commitae38b340dc409f1b9dd66b648eceba09074a2dfd
tree620aa4f90fc9d1c6e0ef1f4ae59f4099c773dab0
parent919bfc105785d024db375c4722a1a6b1745d8e93
IcuCollation::$tailoringFirstLetters: implement letter removal

This is necessary for Swedish, where 'Þ' ("thorn") - considered a
separate letter by default in the first-letters-root.ser file - is
sorted as 'th', causing unexpected output on category pages - words
starting with 'th'..'u' were placed under a heading with the thorn.

There were three obvious ways to do this:
* somehow include information that this letter is to be removed in the
  string itself, as in 'sv' => array( "Å", "Ä", "Ö", "-Þ" ) - could
  potentially clash with valid uses
* create a separate array other than $tailoringFirstLetters to store
  this information - would cause the data to be fragmented all over
  the file
* include information about letters to be removed in a separate key
  "linked" to the regular one, as in '-sv' => array( "Þ" ) - I see no
  obvious downsides, so this is what I ended up doing

Bug: 45446
Change-Id: I57e07a2027c391c5baa767a68f4409b9de7b4618
includes/Collation.php