MediaWiki master
LanguageYue.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Languages;
8
10
16class LanguageYue extends Language {
17
18 private const WORD_SEGMENTATION_REGEX = '/([\xc0-\xff][\x80-\xbf]*)/';
19
21 public function hasWordBreaks() {
22 return false;
23 }
24
33 public function segmentByWord( $string ) {
34 return self::insertSpace( $string, self::WORD_SEGMENTATION_REGEX );
35 }
36}
37
39class_alias( LanguageYue::class, 'LanguageYue' );
Base class for language-specific code.
Definition Language.php:68
static insertSpace( $string, $pattern)
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.Some languages such as Chinese don't convention...