MediaWiki REL1_34
LanguageYue.php
Go to the documentation of this file.
1<?php
29class LanguageYue extends Language {
30
34 function hasWordBreaks() {
35 return false;
36 }
37
46 function segmentByWord( $string ) {
47 $reg = "/([\\xc0-\\xff][\\x80-\\xbf]*)/";
48 $s = self::insertSpace( $string, $reg );
49 return $s;
50 }
51
56 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.
Definition Language.php:37
static convertDoubleWidth( $string)
convert double-width roman characters to single-width.
static insertSpace( $string, $pattern)