Commit graph

45 commits

Author SHA1 Message Date
Reedy
7b3add76b1 Add Unicode to ICU mappings for versions 58 and 59
Change-Id: I87a5e6ce3a44a2be1e6bf8adf2f98cd0a4745574
2017-10-25 23:42:28 +01:00
Umherirrender
14dfc3dbc5 Fix typo in 'language'
Change-Id: I3c4d090640892ae07d3da33dcfe3ace397a40808
2017-10-07 18:53:04 +02:00
Umherirrender
f739a8f368 Improve some parameter docs
Add missing @return and @param to function docs and fixed some @param

Change-Id: I810727961057cfdcc274428b239af5975c57468d
2017-09-10 20:32:31 +02:00
jenkins-bot
1d7a1bf8bd Merge "Move around "ا" to after "آ" and not before" 2017-09-06 13:12:13 +00:00
Amir Sarabadani
2ceba3b145 Move around "ا" to after "آ" and not before
Bug: T173601
Change-Id: I0f6b3ecc2800180a2c6a8217803411862a299e04
2017-08-31 08:02:08 +00:00
Umherirrender
3f1a52805e Use short type bool/int in param documentation
Enable the phpcs sniffs for this and used phpcbf

Change-Id: Iaa36687154ddd2bf663b9dd519f5c99409d37925
2017-08-20 13:20:59 +02:00
Umherirrender
5544cef16b Add missing type to @param documentation
Change-Id: I6b2c9c7af9a281fe457099cc3a336a60a25e74aa
2017-08-11 20:37:35 +02:00
Umherirrender
ace44e2064 Use correct variable name in @param documentation
For some varargs a variable name is added with suffix ,... as seen for
many other varargs

Some @param are swapped, because there are in the wrong order

Enable Sniff MediaWiki.Commenting.FunctionComment.ParamNameNoMatch

Change-Id: I60fec6025bce824d5c67563ab7b65ad6cd628ad8
2017-08-11 19:27:19 +02:00
Kunal Mehta
d1cf48a397 build: Update mediawiki/mediawiki-codesniffer to 0.10.1
And auto-fix all errors.

The `<exclude-pattern>` stanzas are now included in the default ruleset
and don't need to be repeated.

Change-Id: I928af549dc88ac2c6cb82058f64c7c7f3111598a
2017-07-22 18:24:09 -07:00
jenkins-bot
e72303c9f3 Merge "Remove auto-generated "Constructor" documentation on constructors" 2017-07-21 13:19:44 +00:00
Thiemo Mättig
91a920fd85 Remove auto-generated "Constructor" documentation on constructors
Having such comments is worse than not having them. They add zero
information. But you must read the text to understand there is
nothing you don't already know from the class and the method name.

This is similar to I994d11e. Even more trivial, because this here is
about comments that don't say anything but "constructor".

Change-Id: I474dcdb5997bea3aafd11c0760ee072dfaff124c
2017-07-21 12:19:30 +02:00
Bartosz Dziewoński
98627d4cab IcuCollation: Fix diacritic characters for Aromanian (rup) and Moldovan (mo) headings
They should be Ș, Ț (comma-below) and instead they were cedilla-below (Ş, Ţ).
Same as for Romanian (ro) in 486f64f283.

Both of these languages are unsupported by libicu and so the collations
are unlikely to have been used in practice.

Bug: T171043
Bug: T171044
Change-Id: Idd0d593e73cd784fbef7b75e8985f988f5555e26
2017-07-19 21:49:27 +02:00
Brian Wolff
22cb66c175 Update FIRST_LETTER_VERSION for rowiki changes
Can't just clear cache on production, as this
now uses per-server apc instance.

Follow-up 486f64f283

Change-Id: I88df6d5a91c86ef687543d1a6988e0ec050bbfce
2017-07-19 17:56:38 +00:00
Bartosz Dziewoński
486f64f283 IcuCollation: Fix diacritic characters for Romanian (ro) headings
They should be Ș, Ț (comma-below) and instead they were cedilla-below (Ş, Ţ).

Bug: T168711
Change-Id: I6dc873c3ce93bca3e425439f70d0fb30aecc9533
2017-07-19 16:28:02 +02:00
Bartosz Dziewoński
b3caa05a38 CollationFa: Avoid PHP 7 Unicode escape syntax
We still support PHP 5.5.

Change-Id: I587cb794cded95afe7ad493614a6090a108efe6c
2017-06-22 16:22:49 +02:00
Brian Wolff
0bfcbd7240 Hack around icu breakage for fa sorting
Bug: T139110
Change-Id: I35bcdaf309f595258289f01bbe5713ce6d1ffad1
2017-05-19 22:14:43 +00:00
Brian Wolff
73f5937047 Add collation for Bashkir (ba)
This is based on a numeric uppercase collation. Bashkir characters
will be remapped to the private use area for the purpose of sorting.

Bug: T162823
Change-Id: I65f1af0b57ff6ded7d464e39efd401f178a3519e
2017-05-10 04:17:46 +00:00
Timo Tijhof
3a2a707546 Clean up remaining get_class() uses
* get_class()        -> __CLASS__ (same as self::class)
* get_called_class() -> static::class
* get_class($this)   -> static::class

Change-Id: I1888a1897ecf4548a2e5a67a942e5c080dd7e3d3
2017-03-07 22:03:47 +00:00
jenkins-bot
17eda64357 Merge "includes: Replace implicit Bugzilla bug numbers with Phab ones" 2017-02-28 00:51:57 +00:00
Bartosz Dziewoński
267efadac7 Collation: Allow uppercase letters in UCA collations' names
We have several such collations defined in IcuCollation:

* bs-Cyrl
* de-AT@collation=phonebook
* fr-CA
* sr-Latn

They couldn't actually be used.

Change-Id: I3a62073583c49d3e90910aa8240fe9fcc0682386
2017-02-22 21:17:54 +01:00
James D. Forrester
9635dda73a includes: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
2017-02-21 18:13:24 +00:00
Bartosz Dziewoński
afc6e7cd15 CollationFa: Third time's the charm
We have to use a tertiary sortkey for everything with the primary
sortkey of 2627. Otherwise, the "Remove duplicate prefixes" logic
in IcuCollation would remove them.

The following characters will now be considered separate letters in
the 'xx-uca-fa' collation for the purpose of displaying the headings
on category pages: ء ئ ا و ٲ ٳ

Bug: T139110
Change-Id: Ibbea5d76348e4cdc38b74cba44286910b2ed592f
2017-01-05 15:54:00 +01:00
Bartosz Dziewoński
611801a38d IcuCollation: Add the current class name to 'first-letters' cache key
Instances of subclasses of IcuCollation with customizations for
specific languages probably shouldn't share this cache with instances
of IcuCollation with the same language.

Change-Id: I06d66d199c99448a3375381baef0366c4d99c8c4
2016-12-15 15:17:56 +01:00
jenkins-bot
ce079cf6ad Merge "Add CollationFa" 2016-12-15 13:37:56 +00:00
Amir Sarabadani
708c02281e Add CollationFa
Bug: T139110
Change-Id: Ie15a2ee1c22ff4a1d2b721ed137227fe83dd12ea
2016-12-15 13:25:56 +00:00
jenkins-bot
ea42d90053 Merge "Make NumericUppercaseCollation use localized digit transforms" 2016-11-16 02:46:31 +00:00
Brian Wolff
779aa4ce5a Add first letter data for bn collation (Standard and Traditional)
This is based solely on looking at the bn.txt collation data
file. It has not been tested by native speakers.

Bug: T148885
Change-Id: Ide926bc5ee8752269ef6a1bfe972e19b7188d193
2016-11-15 16:09:45 -08:00
Bartosz Dziewoński
37b1fc9456 IcuCollation: Do not split $tailoringFirstLetters into verified/not verified
At this point I think it's safe to assume that these mostly work well,
and the split makes maintenance of the alphabetical list more difficult
(some entries were already in wrong order). We've been enabling these
collations for more and more Wikimedia wikis and not hearing about any
problems. Mistakes, if any are present, should be treated like any
other bug.

Also made some comments consistent.

Change-Id: I4b5fbcf4dbbdd4dc194ed821341296171fa64bb0
2016-10-31 16:48:13 +01:00
Brian Wolff
95c299e67f Add firstLetter data for ~50 additional languages
Based on CLDR 29 data files.

This did the relatively easy languages in CLDR 29 (Which is most
of them). I skipped languages with complicated tailoring files.

Change-Id: I8367604f7d3a1cdef9cb4e15813893c8cbfff1ff
2016-10-29 12:10:52 +00:00
Brian Wolff
e7464f3481 Make NumericUppercaseCollation use localized digit transforms
This will cause the numeric collation to sort localized digits
for the current content language the same as how 0-9 are.

This only deals with the localized digit numbers, commas
and other number formatting are still not handled. Weird
"numerical" unicode characters are also not handled.

I was unsure if to make a "family" of numeric collations
where you specify numeric-<lang code>, or if it should
just use $wgContLang. Given that $wgContLang effectively
never changes, and also affects all other digit handling,
I opted to just use $wgContLang.

Any wikis currently using the 'numeric' collation will
have to have updateCollation.php --force run after this
change is deployed. At the moment that includes:
bnwiki, bnwikisource and hewiki

Bug: T148873
Change-Id: I9eda52a8a9752a91134d1118546b0a80d3980ccf
2016-10-29 08:38:39 +00:00
Kaldari
3c8490b1e3 Fixing numeric sorting for numbers with leading zeros
Bug: T148774
Change-Id: I34aa330645d9d82b6c4e57542e891dd2b36e42ad
2016-10-20 11:58:38 -07:00
Bartosz Dziewoński
cf13e01f38 IcuCollation: Update comments on $tailoringFirstLetters
A few more languages marked as "Verified by native speakers",
based on which collations we've been using in production
on Wikimedia wikis.

(I'm not sure if this makes sense now that we're fairly confident
that these are good in general, but since it's already here...)

Change-Id: I8e1f31fa61509eca8c76a2df4e18638005e68b77
2016-09-22 21:02:15 +00:00
Bartosz Dziewoński
3b84eb02c2 Implement NumericUppercaseCollation
This collation orders text with numbers "naturally", so that
'Foo 1' < 'Foo 2' < 'Foo 12'.

Note that this only works in terms of sequences of digits, and the
behavior for decimal fractions or pretty-formatted numbers may be
unexpected.

This is only expected to work mostly correctly for English-language
text. Consider it a proof of concept. You probably want to use
an UCA collation with '-u-kn' suffix rather than this.

Bug: T8948
Change-Id: Ie268f2d92c5c75d0aaecf54ede2bdda1af3b309d
2016-08-23 18:41:01 +00:00
Kaldari
deaf4ff495 Updating $tailoringFirstLetters for Macedonian
Per https://ssl.icu-project.org/trac/browser/icu/trunk/source/data/coll/mk.txt

Bug: T26953
Change-Id: I45938402923a109cfc80f59555af5cede584fc3b
2016-08-08 13:41:28 -07:00
Kaldari
52c1b00dc0 Adding support for numeric collation when using UCA collations
To use, add '-u-kn' to the end of a collation name and set it as
the value for $wgCategoryCollation.

Bug: T8948
Change-Id: Ica7908daf80624fa2648127114d01665e96234c0
2016-07-26 17:29:41 -07:00
jenkins-bot
68978670d2 Merge "Add Unicode to ICU mappings for versions 51-57" 2016-07-21 05:23:22 +00:00
Reedy
997c071301 Add Unicode to ICU mappings for versions 51-57
Change-Id: I35c2cdd2c56b491229f1f6d8b69b1de21af23aab
2016-07-20 20:47:50 +01:00
Amir Sarabadani
7e657277bf Do not collate "ا" and "و" in Persian language for category sort
Bug: T139110
Change-Id: If174e02160c954500233e3a57945e267f2b4ae29
2016-07-20 14:42:50 +00:00
jenkins-bot
fe7649f43e Merge "Add support for icu-ta collation" 2016-05-30 08:12:41 +00:00
Ori Livneh
8fc4dea679 collation: Remove suppressWarnings() for getSortKey()
Small optimization to IcuCollation::fetchFirstLetterData().

This used to suppress / restore warnings once per every letter of
every alphabet. The workaround for string casting and error
suppression is no longer needed as of PHP 5.3, in which the
bug was fixed.

Change-Id: Idd41a509858c0887df4f632b480b387bd74027b2
2016-05-26 17:43:44 +01:00
Brian Wolff
331ac75c0a Add support for icu-ta collation
First letters are based on
https://ssl.icu-project.org/trac/browser/icu/trunk/source/data/coll/ta.txt
This commit has not been verified by a native speaker yet, but
is probably right.

Bug: T75453
Change-Id: Ic9bb3658868917790aa770c99f8f280f2dd3eace
2016-05-25 10:36:12 -04:00
Timo Tijhof
2a86b5a17a collation: Refactor getFirstLetterData() cache handling
* Factor out fetchFirstLetterData() as a separate method.
* Move 'version' into the key instead of checking afterwards.
* Use getWithSetCallback() for the cache handling.
  (Depends on version being in the key).

Change-Id: I15bddf5d1dabcdcef47a938447ba59436bd8a294
2016-05-09 19:02:35 +00:00
Ori Livneh
87f4d002cc Cache first-letter data in APC, if available
I noticed that `frwiki:first-letters:fr🇫🇷4.8.1.1` was at the very top of keys
sorted by bandwidth (that is, reqs/sec * size) on one of the memcache servers
on WMF prod.

The data takes ~60 - 80ms to compute, in case of a cache miss. That's not
enough to justify using a tiered cache abstraction here, IMO.

Change-Id: If81ce8f86f2c378565f1f6a0dd2c04dee825c4e9
2016-04-11 16:52:57 -07:00
addshore
9b44bc863e Add @since tags to Collation stuff
Change-Id: Iec56ac4d1418737d171f8faa9c8f498fba5383ee
2016-04-03 11:37:40 +03:00
addshore
e8c15f0e94 Split Collation.php
Change-Id: I6abfecf91cdce83dd34b1e8aa8e0b35315f62742
2016-04-03 11:23:20 +03:00