didn't mean to commit this
[mediawiki.git] / languages / classes / LanguageYue.php
blobaff3d29ec8acb19cb0981559e890d00c45562ca7
1 <?php
2 /**
3 * Cantonese (粵語)
5 * @ingroup Language
6 */
7 class LanguageYue extends Language {
8 function hasWordBreaks() {
9 return false;
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...
17 function segmentByWord( $string ) {
18 $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
19 $s = self::insertSpace( $string, $reg );
20 return $s;
23 function normalizeForSearch( $string ) {
24 wfProfileIn( __METHOD__ );
26 // Double-width roman characters
27 $s = self::convertDoubleWidth( $string );
28 $s = trim( $s );
29 $s = parent::normalizeForSearch( $s );
31 wfProfileOut( __METHOD__ );
32 return $s;