imliam / php-indefinite-article

Determine the indefinite article of an English term

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP Indefinite Articles

Latest Version on Packagist Build Status Code Quality Code Coverage Total Downloads License

Determine the indefinite article of an English term.

An indefinite article is the word that comes before nouns or noun equivalents in English, such as "a" or "an". If the word starts with a consonant sound, the article used should be "a" β€” for example "banana" becomes "a banana". If the word starts with a vowel sound, the article used should be "an" β€” for example "apple" becomes "an apple".

This is not as simple as checking whether the first character of the word is a vowel or consonant as that does not determine the sound pronounced when speaking the word.

This is a port of Eamon Nerbonne's original solution for the problem.

πŸ’Ύ Installation

You can install the package with Composer using the following command:

composer require imliam/php-indefinite-article:^1.0.0

πŸ“ Usage

$word = new ImLiam\IndefiniteArticle\IndefiniteArticle('apple');

echo $word->parse();
// "an apple"

echo $word->article();
// "an"

βœ… Testing

composer test

πŸ”– Changelog

Please see the changelog file for more information on what has changed recently.

⬆️ Upgrading

Please see the upgrading file for details on upgrading from previous versions.

πŸŽ‰ Contributing

Please see the contributing file and code of conduct for details on contributing to the project.

πŸ”’ Security

If you discover any security related issues, please email liam@liamhammett.com instead of using the issue tracker.

πŸ‘· Credits

♻️ License

The MIT License (MIT). Please see the license file for more information.

About

Determine the indefinite article of an English term

License:MIT License


Languages

Language:PHP 100.0%