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