From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- languages/classes/LanguageYue.php | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'languages/classes/LanguageYue.php') diff --git a/languages/classes/LanguageYue.php b/languages/classes/LanguageYue.php index fc7f233c..6581d788 100644 --- a/languages/classes/LanguageYue.php +++ b/languages/classes/LanguageYue.php @@ -3,19 +3,30 @@ * @ingroup Language */ class LanguageYue extends Language { - function stripForSearch( $string ) { + function hasWordBreaks() { + return false; + } + + /** + * Eventually this should be a word segmentation; + * for now just treat each character as a word. + * @todo Fixme: only do this for Han characters... + */ + function wordSegmentation( $string ) { + $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/"; + $s = self::insertSpace( $string, $reg ); + return $s; + } + + function normalizeForSearch( $string ) { wfProfileIn( __METHOD__ ); - // eventually this should be a word segmentation - // for now just treat each character as a word - // @fixme only do this for Han characters... - $t = preg_replace( - "/([\\xc0-\\xff][\\x80-\\xbf]*)/", - " $1", $string); + // Double-width roman characters + $s = self::convertDoubleWidth( $string ); + $s = trim( $s ); + $s = parent::normalizeForSearch( $s ); - // Do general case folding and UTF-8 armoring - $t = parent::stripForSearch( $t ); wfProfileOut( __METHOD__ ); - return $t; + return $s; } } -- cgit v1.2.2