MediaWiki  REL1_19
LanguageJa.php
Go to the documentation of this file.
00001 <?php
00002 
00008 class LanguageJa extends Language {
00009 
00014         function segmentByWord( $string ) {
00015                 // Strip known punctuation ?
00016                 // $s = preg_replace( '/\xe3\x80[\x80-\xbf]/', '', $s ); # U3000-303f
00017 
00018                 // Space strings of like hiragana/katakana/kanji
00019                 $hiragana = '(?:\xe3(?:\x81[\x80-\xbf]|\x82[\x80-\x9f]))'; # U3040-309f
00020                 $katakana = '(?:\xe3(?:\x82[\xa0-\xbf]|\x83[\x80-\xbf]))'; # U30a0-30ff
00021                 $kanji = '(?:\xe3[\x88-\xbf][\x80-\xbf]'
00022                         . '|[\xe4-\xe8][\x80-\xbf]{2}'
00023                         . '|\xe9[\x80-\xa5][\x80-\xbf]'
00024                         . '|\xe9\xa6[\x80-\x99])';
00025                         # U3200-9999 = \xe3\x88\x80-\xe9\xa6\x99
00026                 $reg = "/({$hiragana}+|{$katakana}+|{$kanji}+)/";
00027                 $s = self::insertSpace( $string, $reg );
00028                 return $s;
00029         }
00030 
00038         function emphasize( $text ) {
00039                 return $text;
00040         }
00041 }