PHP Class JpnForPhp\Transliterator\Kana

Author: Matthieu Bilbille (@mbibille)
Inheritance: extends TransliterationSystem
Datei anzeigen Open project: mbilbille/jpnforphp Class Usage Examples

Public Methods

Method Description
__construct ( $system = '' ) Kana's constructor
__toString ( ) Implements __toString().
transliterate ( $str, $stripwhitespace = self::STRIP_WHITESPACE_NONE ) Override transliterate().

Protected Methods

Method Description
convertHiraganaToKatakana ( string $str ) : string Hack to call Helper::convertHiraganaToKatakana() within the transliteration workflow.
preTransliterate ( $str ) Override preTransliterate().
prepareChoonpuTransliteration ( string $str ) : string Prepare a string for to transliterate choonpu into kana.
prepareLongVowelsTransliteration ( string $str, array $parameters ) : string Prepare a string for to transliterate long vowels into kana.
transliterateDefaultCharacters ( string $str, array $parameters ) : string Convert the given string into kana using the specified mapping.
transliterateQuotationMarks ( string $str ) : string Transliterate quotation mark into their equivalent in Japanese syllabary.
transliterateSokuon ( string $str, array $parameters ) : string Transliterate proper combinaisons of latin alphabet characters into Sokuon (http://en.wikipedia.org/wiki/Sokuon) characters.

Method Details

__construct() public method

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

__toString() public method

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

convertHiraganaToKatakana() protected method

Hack to call Helper::convertHiraganaToKatakana() within the transliteration workflow.
See also: JpnForPhp\Helper\Helper::convertHiraganaToKatakana()
protected convertHiraganaToKatakana ( string $str ) : string
$str string String to be converted.
return string Converted string.

preTransliterate() protected method

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

prepareChoonpuTransliteration() protected method

Prepare a string for to transliterate choonpu into kana.
protected prepareChoonpuTransliteration ( string $str ) : string
$str string String to be prepared.
return string Prepared string.

prepareLongVowelsTransliteration() protected method

Prepare a string for to transliterate long vowels into kana.
protected prepareLongVowelsTransliteration ( string $str, array $parameters ) : string
$str string String to be prepared.
$parameters array Long vowels mapping.
return string Prepared string.

transliterate() public method

Override transliterate().
See also: TransliterationSystem
public transliterate ( $str, $stripwhitespace = self::STRIP_WHITESPACE_NONE )

transliterateDefaultCharacters() protected method

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

transliterateQuotationMarks() protected method

Transliterate quotation mark into their equivalent in Japanese syllabary.
protected transliterateQuotationMarks ( string $str ) : string
$str string String to be transliterated.
return string Transliterated string.

transliterateSokuon() protected method

Transliterate proper combinaisons of latin alphabet characters into Sokuon (http://en.wikipedia.org/wiki/Sokuon) characters.
protected transliterateSokuon ( string $str, array $parameters ) : string
$str string String to be transliterated.
$parameters array Sokuon character.
return string Transliterated string.