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