GetPhoneticReading
in package
Use case for converting text to phonetic representation.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- execute() : string
- Convert text to phonetic representation using MeCab (for Japanese).
- getByCode() : string
- Convert text to phonetic representation by language code.
- processMecabPhonetic() : string
- Process text through MeCab for phonetic reading.
Properties
$repository
private
LanguageRepositoryInterface
$repository
Methods
__construct()
public
__construct([LanguageRepositoryInterface|null $repository = null ]) : mixed
Parameters
- $repository : LanguageRepositoryInterface|null = null
-
Repository instance
execute()
Convert text to phonetic representation using MeCab (for Japanese).
public
execute(string $text, int $id) : string
Parameters
- $text : string
-
Text to be converted
- $id : int
-
Language ID
Return values
string —Parsed text in phonetic format
getByCode()
Convert text to phonetic representation by language code.
public
getByCode(string $text, string $lang) : string
Parameters
- $text : string
-
Text to be converted
- $lang : string
-
Language code (usually BCP 47 or ISO 639-1)
Return values
string —Parsed text in phonetic format
processMecabPhonetic()
Process text through MeCab for phonetic reading.
private
processMecabPhonetic(string $text) : string
Parameters
- $text : string
-
Text to process
Return values
string —Phonetic reading from MeCab