MediaWiki  master
LanguageYue.php
Go to the documentation of this file.
1 <?php
26 class LanguageYue extends Language {
27 
31  public function hasWordBreaks() {
32  return false;
33  }
34 
43  public function segmentByWord( $string ) {
44  $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
45  $s = self::insertSpace( $string, $reg );
46  return $s;
47  }
48 
53  public function normalizeForSearch( $string ) {
54  // Double-width roman characters
55  $s = self::convertDoubleWidth( $string );
56  $s = trim( $s );
57  $s = parent::normalizeForSearch( $s );
58 
59  return $s;
60  }
61 }
Cantonese (粵語)
Definition: LanguageYue.php:26
normalizeForSearch( $string)
Definition: LanguageYue.php:53
segmentByWord( $string)
Eventually this should be a word segmentation; for now just treat each character as a word.
Definition: LanguageYue.php:43
Base class for language-specific code.
Definition: Language.php:54
static convertDoubleWidth( $string)
convert double-width roman characters to single-width.
Definition: Language.php:2888
static insertSpace( $string, $pattern)
Definition: Language.php:2908
foreach( $mmfl['setupFiles'] as $fileName) if( $queue) if(empty( $mmfl['quiet'])) $s