PHP Class JpnForPhp\Transliterator\Romaji

Author: Matthieu Bilbille (@mbibille)
Inheritance: extends TransliterationSystem
ファイルを表示 Open project: mbilbille/jpnforphp

Public Methods

Method Description
__construct ( $system = '' ) Romaji's constructor
__toString ( ) Implements __toString().

Protected Methods

Method Description
postTransliterate ( $str ) Override postTransliterate().
preTransliterate ( $str ) Override preTransliterate().
transliterateChoonpu ( string $str, array $parameters ) : string Transliterate Chōonpu (http://en.wikipedia.org/wiki/Chōonpu) character into its equivalent in latin alphabet.
transliterateDefaultCharacters ( string $str, array $parameters ) : string Use the specified mapping to transliterate the given string into romaji
transliterateLongVowels ( string $str, array $parameters ) : string Transliterate long vowels as per the given mapping.
transliterateNBeforeLabialConsonants ( string $str ) : string Transliterate character 'n' to 'm' before labial consonants.
transliterateParticles ( string $str, array $parameters ) : string Transliterate particules as per the given mapping.
transliterateSokuon ( string $str, array $parameters ) : string Transliterate Sokuon (http://en.wikipedia.org/wiki/Sokuon) character into its equivalent in latin alphabet.

Private Methods

Method Description
escapeLatinCharacters ( $str ) Escapes latin characters [a-z].
espaceLatinCharactersCallback ( $matches ) Private callback for escapeLatinCharacters().
unescapeLatinCharacters ( $str ) Unescapes latin characters [a-z].

Method Details

__construct() public method

Romaji's constructor
public __construct ( $system = '' )

__toString() public method

Implements __toString().
See also: TransliterationSystem
public __toString ( )

postTransliterate() protected method

Override postTransliterate().
See also: TransliterationSystem
protected postTransliterate ( $str )

preTransliterate() protected method

Override preTransliterate().
See also: TransliterationSystem
protected preTransliterate ( $str )

transliterateChoonpu() protected method

Transliterate Chōonpu (http://en.wikipedia.org/wiki/Chōonpu) character into its equivalent in latin alphabet.
protected transliterateChoonpu ( string $str, array $parameters ) : string
$str string String to be transliterated.
$parameters array Macrons mapping.
return string Transliterated string.

transliterateDefaultCharacters() protected method

Use the specified mapping to transliterate the given string into romaji
protected transliterateDefaultCharacters ( string $str, array $parameters ) : string
$str string String to be converted.
$parameters array Characters mapping.
return string Converted string.

transliterateLongVowels() protected method

Transliterate long vowels as per the given mapping.
protected transliterateLongVowels ( string $str, array $parameters ) : string
$str string String to be transliterated.
$parameters array Long vowels mapping.
return string Transliterated string.

transliterateNBeforeLabialConsonants() protected method

Transliterate character 'n' to 'm' before labial consonants.
protected transliterateNBeforeLabialConsonants ( string $str ) : string
$str string String to be transliterated.
return string Transliterated string.

transliterateParticles() protected method

Transliterate particules as per the given mapping.
protected transliterateParticles ( string $str, array $parameters ) : string
$str string String to be transliterated.
$parameters array Particules mapping.
return string Transliterated string.

transliterateSokuon() protected method

Transliterate Sokuon (http://en.wikipedia.org/wiki/Sokuon) character into its equivalent in latin alphabet.
protected transliterateSokuon ( string $str, array $parameters ) : string
$str string String to be transliterated.
$parameters array Default or Hepburn transliteration.
return string Transliterated string.