PHPackages                             spenserhale/indefinite-article - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. spenserhale/indefinite-article

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spenserhale/indefinite-article
==============================

Grammatical utility class for prepending the appropriate indefinite article to a word (a/an)

v1.0.1(7y ago)27.8k1BSD-2-ClausePHPPHP &gt;= 7.2.2

Since Sep 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/spenserhale/php-indefinite-article)[ Packagist](https://packagist.org/packages/spenserhale/indefinite-article)[ RSS](/packages/spenserhale-indefinite-article/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

PHP Indefinite Article Library
==============================

[](#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), and then by [make into composer package](https://github.com/zachflower/php-indefinite-article) by [Zach Flower](https://zacharyflower.com/).

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

Require the library and update via [Composer](https://getcomposer.org/):

```
composer require spenserhale/indefinite-article
composer update

```

### Manually

[](#manually)

Download the [latest release](https://github.com/spenserhale/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
-----

[](#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
---------------------

[](#copyright-and-license)

Original Perl module Copyright © 1997-2009 Damian Conway; Original PHP port Copyright © 2012 Niko Salminen; Original library copyright © 2016 Zachary Flower; Current library copyright © 2018 Spenser Hale; Code released under the [BSD license](LICENSE).

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 56.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~325 days

Total

3

Last Release

2886d ago

Major Versions

v0.1.0 → v1.0.02018-06-14

PHP version history (2 changes)v0.1.0PHP &gt;= 5.3.0

v1.0.0PHP &gt;= 7.2.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/f16952fe5cd35044cf68bac905c9880af4219a0f4318bba55bc03bd6b9f1379f?d=identicon)[spenserhale](/maintainers/spenserhale)

---

Top Contributors

[![spenserhale](https://avatars.githubusercontent.com/u/5643366?v=4)](https://github.com/spenserhale "spenserhale (13 commits)")[![Kaivosukeltaja](https://avatars.githubusercontent.com/u/881135?v=4)](https://github.com/Kaivosukeltaja "Kaivosukeltaja (5 commits)")[![kjbjm](https://avatars.githubusercontent.com/u/2024496?v=4)](https://github.com/kjbjm "kjbjm (3 commits)")[![zachflower](https://avatars.githubusercontent.com/u/920019?v=4)](https://github.com/zachflower "zachflower (2 commits)")

---

Tags

phptextgrammar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spenserhale-indefinite-article/health.svg)

```
[![Health](https://phpackages.com/badges/spenserhale-indefinite-article/health.svg)](https://phpackages.com/packages/spenserhale-indefinite-article)
```

###  Alternatives

[povils/figlet

Figlet text generator - PHP

616.8k4](/packages/povils-figlet)[akh/typograf

Типография текста

1925.3k2](/packages/akh-typograf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
