public static function inflect($verb, $forms = array())
{
$result = array();
if (!$verb) {
return $result;
}
$type = $verb['type'];
$mapVerbs = self::makeVerbMappings();
if (!array_key_exists($type, $mapVerbs)) {
throw new Exception("Unknown verb type : " . $type);
}
$mappings = $mapVerbs[$type];
if (is_string($forms)) {
return self::inflectForm($verb, $mappings, $forms);
} elseif (!$forms) {
$forms = self::$ALL;
}
foreach ($forms as $form) {
$result[$form] = self::inflectForm($verb, $mappings, $form);
}
return $result;
}