diff options
Diffstat (limited to 'languages/classes/LanguageYue.php')
-rw-r--r-- | languages/classes/LanguageYue.php | 31 |
1 files changed, 21 insertions, 10 deletions
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; } } |