PHP Class JpnForPhp\Inflector\Inflector

Author: Axel Bodart (@akeru) based on work by Fabien SK (@fabiensk)
Exibir arquivo Open project: mbilbille/jpnforphp Class Usage Examples

Public Methods

Method Description
createDatabase ( ) Helper method the generate the database. The JMDict file my be downloaded separately
getRadicals ( array $verb, $form ) : array Inflects radical for the given verb to the given form
getVerb ( $verb ) : array Gets a verb entry from the database using either Kanji, Hiragana or Romaji
inflect ( $verb, array $forms = [] ) : array Inflects the verb to given forms or all if none input

Private Methods

Method Description
inflectForm ( array $verb, array $mappings, $form ) : array Generates conjugation for the given verb to the given type using the given mappings
makeVerbMapping ( array &$verb ) : array Generates stub mapping for a given verb type
makeVerbMappings ( ) : array Generates full mapping for all known verb types

Method Details

createDatabase() public static method

Helper method the generate the database. The JMDict file my be downloaded separately
public static createDatabase ( )

getRadicals() public static method

Inflects radical for the given verb to the given form
public static getRadicals ( array $verb, $form ) : array
$verb array
$form
return array

getVerb() public static method

Gets a verb entry from the database using either Kanji, Hiragana or Romaji
public static getVerb ( $verb ) : array
$verb
return array

inflect() public static method

Inflects the verb to given forms or all if none input
public static inflect ( $verb, array $forms = [] ) : array
$verb
$forms array
return array