MediaWiki REL1_39
LanguageYue.php
Go to the documentation of this file.
1<?php
26class 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 (粵語)
normalizeForSearch( $string)
segmentByWord( $string)
Eventually this should be a word segmentation; for now just treat each character as a word.
Base class for language-specific code.
Definition Language.php:53
static convertDoubleWidth( $string)
convert double-width roman characters to single-width.
static insertSpace( $string, $pattern)
foreach( $mmfl['setupFiles'] as $fileName) if($queue) if(empty( $mmfl['quiet'])) $s