MediaWiki REL1_35
LanguageYue.php
Go to the documentation of this file.
1<?php
29class 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}
Cantonese (粵語)
normalizeForSearch( $string)
segmentByWord( $string)
Eventually this should be a word segmentation; for now just treat each character as a word.
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition Language.php:41
static convertDoubleWidth( $string)
convert double-width roman characters to single-width.
static insertSpace( $string, $pattern)