PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words. The Doctrine Inflector has methods for inflecting text. The features include pluralization, singularization, converting between camelCase and under_score and capitalizing words. Using the inflector is easy, you can create a new Doctrine\Inflector\Inflector instance by using the Doctrine\Inflector\InflectorFactory class. By default it will create an English inflector. If you want to use another language, you can do so. The supported languages are English, Spanish, French, Portuguese, Norwegian Bokmal and Turkish. If you are interested in adding support for your language, take a look at the other languages defined in the Doctrine\Inflector\Rules namespace and the tests located in Doctrine\Tests\Inflector\Rules. You can copy one of the languages and update the rules for your language.

Features

  • You can setup custom singular and plural rules
  • You can configure an inflector that doesn't perform any operation for pluralization and/or singularization
  • You can unaccent a string of text
  • You can change pluralization and singularization within your text
  • You can also use it to change between upper and lowercase
  • The API present in Inflector 1.x is still available

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow Doctrine Inflector

Doctrine Inflector Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Doctrine Inflector!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Libraries

Registered

2021-06-02