Added result properties to action=paraminfo
[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
10 /**
11 * @return bool
12 */
13 function hasWordBreaks() {
14 return false;
15 }
16
17 /**
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 *
22 * @param $string string
23 *
24 * @return string
25 */
26 function segmentByWord( $string ) {
27 $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
28 $s = self::insertSpace( $string, $reg );
29 return $s;
30 }
31
32 /**
33 * @param $s
34 * @return string
35 */
36 function normalizeForSearch( $s ) {
37 wfProfileIn( __METHOD__ );
38
39 // Double-width roman characters
40 $s = parent::normalizeForSearch( $s );
41 $s = trim( $s );
42 $s = $this->segmentByWord( $s );
43
44 wfProfileOut( __METHOD__ );
45 return $s;
46 }
47 }