PHP Class JpnForPhp\Inflector\Inflector

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

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

getRadicals() public static méthode

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

getVerb() public static méthode

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

inflect() public static méthode

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