Readding parserTests.php and testHelpers.inc with history back to r73884 when they...
[mediawiki.git] / languages / classes / LanguageZh_hans.php
bloba65162bc1cdf88cae2ca6e79cc5001d3c47bbf8c
1 <?php
3 /**
4 * Simplified Chinese
6 * @ingroup Language
7 */
8 class LanguageZh_hans extends Language {
9 function hasWordBreaks() {
10 return false;
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...
18 function segmentByWord( $string ) {
19 $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
20 $s = self::insertSpace( $string, $reg );
21 return $s;
24 function normalizeForSearch( $s ) {
25 wfProfileIn( __METHOD__ );
27 // Double-width roman characters
28 $s = parent::normalizeForSearch( $s );
29 $s = trim( $s );
30 $s = $this->segmentByWord( $s );
32 wfProfileOut( __METHOD__ );
33 return $s;