enflow/component-inflector

This package is abandoned and no longer maintained. No replacement package was suggested.

Multilingual inflector that can singularize and pluralize words.

v0.3.0 2020-03-04 14:03 UTC

This package is auto-updated.

Last update: 2021-05-04 16:28:36 UTC


README

Latest Version on Packagist Software License Build Status Total Downloads

The enflow/component-inflector package provides a easy way to singularize and pluralize words in multiple languages.

The following languages are currently supported. Pull requests are welcome!

  • English (en)
  • Dutch (nl)

Component is based on cakephp/utility and noud/cakephp-dutch.

Installation

You can install the package via composer:

composer require enflow/component-inflector

Usage

use Enflow\Component\Inflector\Inflector;

$inflector = Inflector::forLanguageCode('en');

echo $inflector->singularize('apples') // Outputs: apple
echo $inflector->pluralize('apple') // Outputs: apples

Or specify a custom language which extends the abstract Language class:

use Enflow\Component\Inflector\Inflector;

$inflector = Inflector::forLanguage(new YourLanguageClass());

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email michel@enflow.nl instead of using the issue tracker.

Credits

Special thanks to Freek Van der Herten for providing the package template & multiple useful packages.

About Enflow

Enflow is a digital creative agency based in Alphen aan den Rijn, Netherlands. We specialize in developing web applications, mobile applications and websites. You can find more info on our website.

License

The MIT License (MIT). Please see License File for more information.