https://github.com/zachflower/php-indefinite-article
PHP port of the Lingua::EN::Inflect Perl module's A() and AN() subroutines
https://github.com/zachflower/php-indefinite-article
Last synced: 5 months ago
JSON representation
PHP port of the Lingua::EN::Inflect Perl module's A() and AN() subroutines
- Host: GitHub
- URL: https://github.com/zachflower/php-indefinite-article
- Owner: zachflower
- License: other
- Fork: true (Kaivosukeltaja/php-indefinite-article)
- Created: 2016-09-01T16:27:05.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-01-26T16:25:09.000Z (over 8 years ago)
- Last Synced: 2025-09-28T10:49:44.354Z (9 months ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Indefinite Article Library
PHP implementation of the [Lingua::EN::Inflect](http://search.cpan.org/dist/Lingua-EN-Inflect/lib/Lingua/EN/Inflect.pm) Perl module's A() and AN() subroutines, originally [ported to PHP](https://github.com/Kaivosukeltaja/php-indefinite-article) by [Niko Salminen](http://nikosalminen.com).
## Installation
### Via Composer
Require the library and update via [Composer](https://getcomposer.org/):
```
composer require zachflower/indefinite-article
composer update
```
### Manually
Download the [latest release](https://github.com/zachflower/php-indefinite-article/archive/master.zip), extract into a directory called `indefinite-article`, and include the library at the beginning of your script:
```
include_once('./indefinite-articles/src/IndefiniteArticle.php');
use \IndefiniteArticle\IndefiniteArticle;
```
## Usage
The PHP Indefinite Article Library is used to determine the proper indefinite article to use before a word ('a' or 'an'). To do so, simply call the `A()` method with your word or phrase:
```
IndefiniteArticle::A('elephant')
```
The method will return a string prefixed with the appropriate indefinite article:
```
an elephant
```
## Copyright and License
Original Perl module Copyright © 1997-2009 Damian Conway; Original PHP port Copyright © 2012 Niko Salminen; Current library copyright © 2016 Zachary Flower; Code released under the [BSD license](LICENSE).