Localisation updates from http://translatewiki.net.
[mediawiki.git] / languages / classes / LanguageZh_hans.php
blob671a16e7cc45dd6480ca462343d2358be36d034d
1 <?php
3 /**
4 * Simplified Chinese
6 * @ingroup Language
7 */
8 class LanguageZh_hans extends Language {
10 /**
11 * @return bool
13 function hasWordBreaks() {
14 return false;
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...
22 * @param $string string
24 * @return string
26 function segmentByWord( $string ) {
27 $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
28 $s = self::insertSpace( $string, $reg );
29 return $s;
32 /**
33 * @param $s
34 * @return string
36 function normalizeForSearch( $s ) {
37 wfProfileIn( __METHOD__ );
39 // Double-width roman characters
40 $s = parent::normalizeForSearch( $s );
41 $s = trim( $s );
42 $s = $this->segmentByWord( $s );
44 wfProfileOut( __METHOD__ );
45 return $s;