MediaWiki master
LanguageYue.php
Go to the documentation of this file.
1<?php
22
28class LanguageYue extends Language {
29
30 private const WORD_SEGMENTATION_REGEX = '/([\xc0-\xff][\x80-\xbf]*)/';
31
32 public function hasWordBreaks() {
33 return false;
34 }
35
44 public function segmentByWord( $string ) {
45 return self::insertSpace( $string, self::WORD_SEGMENTATION_REGEX );
46 }
47}
Cantonese (粵語)
segmentByWord( $string)
Eventually, this should be a word segmentation; but for now just treat each character as a word.
hasWordBreaks()
Most writing systems use whitespace to break up words.
Base class for language-specific code.
Definition Language.php:81
static insertSpace( $string, $pattern)