MediaWiki
master
LanguageJa.php
Go to the documentation of this file.
1
<?php
21
use
MediaWiki\Language\Language
;
22
28
class
LanguageJa
extends
Language
{
29
31
private
const
WORD_SEG_HIRAGANA =
'(?:\xe3(?:\x81[\x80-\xbf]|\x82[\x80-\x9f]))'
;
32
34
private
const
WORD_SEG_KATAKANA =
'(?:\xe3(?:\x82[\xa0-\xbf]|\x83[\x80-\xbf]))'
;
35
37
private
const
WORD_SEG_KANJI =
38
'(?:\xe3[\x88-\xbf][\x80-\xbf]|[\xe4-\xe8][\x80-\xbf]{2}|\xe9[\x80-\xa5][\x80-\xbf]|\xe9\xa6[\x80-\x99])'
;
39
40
private
const
WORD_SEGMENTATION_REGEX =
41
'/('
. self::WORD_SEG_HIRAGANA .
'+|'
. self::WORD_SEG_KATAKANA .
'+|'
. self::WORD_SEG_KANJI .
'+)/'
;
42
43
public
function
segmentByWord
( $string ) {
44
return
self::insertSpace
( $string, self::WORD_SEGMENTATION_REGEX );
45
}
46
54
public
function
emphasize
( $text ) {
55
return
$text;
56
}
57
}
LanguageJa
Japanese (日本語)
Definition
LanguageJa.php:28
LanguageJa\segmentByWord
segmentByWord( $string)
Some languages such as Chinese require word segmentation, Specify such segmentation when overridden i...
Definition
LanguageJa.php:43
LanguageJa\emphasize
emphasize( $text)
Italic is not appropriate for Japanese script.
Definition
LanguageJa.php:54
MediaWiki\Language\Language
Base class for language-specific code.
Definition
Language.php:79
MediaWiki\Language\Language\insertSpace
static insertSpace( $string, $pattern)
Definition
Language.php:2836
includes
languages
LanguageJa.php
Generated on Sun Oct 13 2024 17:23:58 for MediaWiki by
1.10.0