Follow up r60742, r60743, r60764, r60766, r61214, r61390. Split stripForSearch into...
[lhc/web/wiklou.git] / languages / classes / LanguageYue.php
1 <?php
2 /**
3 * @ingroup Language
4 */
5 class LanguageYue extends Language {
6 function hasWordBreaks() {
7 return false;
8 }
9
10 /**
11 * Eventually this should be a word segmentation;
12 * for now just treat each character as a word.
13 * @todo Fixme: only do this for Han characters...
14 */
15 function wordSegmentation( $string ) {
16 $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
17 $s = self::insertSpace( $string, $reg );
18 return $s;
19 }
20
21 function normalizeForSearch( $string ) {
22 wfProfileIn( __METHOD__ );
23
24 // Double-width roman characters
25 $s = self::convertDoubleWidth( $string );
26 $s = trim( $s );
27 $s = parent::normalizeForSearch( $s );
28
29 wfProfileOut( __METHOD__ );
30 return $s;
31 }
32 }