Perform search on every word of language name

See e.g. T132021. This favours coverage over quality.

Change-Id: I3fc8fb1702802bc002c3d7e2941563840914f325
This commit is contained in:
Niklas Laxström
2017-10-31 16:59:06 +01:00
committed by Amire80
parent a9dc4a0f1a
commit a353c5ab65
4 changed files with 8824 additions and 12 deletions

View File

@@ -19,11 +19,7 @@
*/
class LanguageNameSearch {
public static function search( $searchKey, $typos = 0 ) {
// Use code's mb_strtolower compatibily code for MW < 1.27
$language = Language::factory( 'en' );
// @todo: Shouldn't this be unicode aware?
$searchKey = $language->lc( $searchKey );
$searchKey = mb_strtolower( $searchKey );
$index = self::getIndex( $searchKey );
if ( !isset( LanguageNameSearchData::$buckets[$index] ) ) {