Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F8108850
LanguageJa.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
LanguageJa.php
View Options
<?php
/**
* @license GPL-2.0-or-later
* @file
*/
use
MediaWiki\Language\Language
;
/**
* Japanese (日本語)
*
* @ingroup Languages
*/
class
LanguageJa
extends
Language
{
/** Space string for hiragana - unicode range U3040-309f */
private
const
WORD_SEG_HIRAGANA
=
'(?:
\x
e3(?:
\x
81[
\x
80-
\x
bf]|
\x
82[
\x
80-
\x
9f]))'
;
/** Space string for katakana - unicode range U30a0-30ff */
private
const
WORD_SEG_KATAKANA
=
'(?:
\x
e3(?:
\x
82[
\x
a0-
\x
bf]|
\x
83[
\x
80-
\x
bf]))'
;
/** Space string for kanji - unicode range U3200-9999 = \xe3\x88\x80-\xe9\xa6\x99 */
private
const
WORD_SEG_KANJI
=
'(?:
\x
e3[
\x
88-
\x
bf][
\x
80-
\x
bf]|[
\x
e4-
\x
e8][
\x
80-
\x
bf]{2}|
\x
e9[
\x
80-
\x
a5][
\x
80-
\x
bf]|
\x
e9
\x
a6[
\x
80-
\x
99])'
;
private
const
WORD_SEGMENTATION_REGEX
=
'/('
.
self
::
WORD_SEG_HIRAGANA
.
'+|'
.
self
::
WORD_SEG_KATAKANA
.
'+|'
.
self
::
WORD_SEG_KANJI
.
'+)/'
;
/** @inheritDoc */
public
function
segmentByWord
(
$string
)
{
return
self
::
insertSpace
(
$string
,
self
::
WORD_SEGMENTATION_REGEX
);
}
/**
* Italic is not appropriate for Japanese script.
* Unfortunately, most browsers do not recognise this, and render `<em>` as italic.
*
* @param string $text
* @return string
*/
public
function
emphasize
(
$text
)
{
return
$text
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Dec 8, 04:00 (1 d, 11 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
30/da/cfbadbd22798e2fb298dc029aa09
Default Alt Text
LanguageJa.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment