inflector icon indicating copy to clipboard operation
inflector copied to clipboard

withIrregulars method for InflectorFactory

Open cesarep opened this issue 2 years ago • 0 comments

Adds a new method for the in LanguageInflectorFactory along with a test for it. It allows to specify an array of custom Irregular substitutions:

$irregulars = [
   ['singular1', 'plural1'],
   ['singular2', 'plural2'],
   [...]
];

InflectorFactory::create()->withIrregulars($irregulars)->build();

Should be very useful when a given ruleset is not getting some word right, the user could manually set the words it needs

cesarep avatar Apr 17 '22 15:04 cesarep