]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - languages/classes/LanguageYue.php
MediaWiki 1.17.0
[autoinstalls/mediawiki.git] / languages / classes / LanguageYue.php
1 <?php
2 /**
3  * Cantonese (粵語)
4  *
5  * @ingroup Language
6  */
7 class LanguageYue extends Language {
8         function hasWordBreaks() {
9                 return false;
10         }
11
12         /**
13          * Eventually this should be a word segmentation;
14          * for now just treat each character as a word.
15          * @todo Fixme: only do this for Han characters...
16          */
17         function segmentByWord( $string ) {
18                 $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
19                 $s = self::insertSpace( $string, $reg );
20                 return $s;
21         }
22
23         function normalizeForSearch( $string ) {
24                 wfProfileIn( __METHOD__ );
25
26                 // Double-width roman characters
27                 $s = self::convertDoubleWidth( $string );
28                 $s = trim( $s );
29                 $s = parent::normalizeForSearch( $s );
30
31                 wfProfileOut( __METHOD__ );
32                 return $s;
33         }
34 }