MediaWiki  master
LanguageYue.php
Go to the documentation of this file.
1 <?php
29 class LanguageYue extends Language {
30 
34  public function hasWordBreaks() {
35  return false;
36  }
37 
46  public function segmentByWord( $string ) {
47  $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
48  $s = self::insertSpace( $string, $reg );
49  return $s;
50  }
51 
56  public function normalizeForSearch( $string ) {
57  // Double-width roman characters
58  $s = self::convertDoubleWidth( $string );
59  $s = trim( $s );
60  $s = parent::normalizeForSearch( $s );
61 
62  return $s;
63  }
64 }
$s
$s
Definition: mergeMessageFileList.php:185
LanguageYue\hasWordBreaks
hasWordBreaks()
Definition: LanguageYue.php:34
Language\convertDoubleWidth
static convertDoubleWidth( $string)
convert double-width roman characters to single-width.
Definition: Language.php:2849
LanguageYue\segmentByWord
segmentByWord( $string)
Eventually this should be a word segmentation; for now just treat each character as a word.
Definition: LanguageYue.php:46
LanguageYue\normalizeForSearch
normalizeForSearch( $string)
Definition: LanguageYue.php:56
LanguageYue
Cantonese (粵語)
Definition: LanguageYue.php:29
Language\insertSpace
static insertSpace( $string, $pattern)
Definition: Language.php:2869
Language
Internationalisation code.
Definition: Language.php:39