zachflower/indefinite-article

用于程序化确定使用适当的不定冠词(a/an)的库

v0.1.0 2016-09-01 18:15 UTC

This package is auto-updated.

Last update: 2024-08-29 00:01:38 UTC


README

PHP 实现了 Perl 模块 Lingua::EN::Inflect 的 A() 和 AN() 子程序,最初由 Niko Salminen 转换到 PHP。

安装

通过 Composer

需要库并通过 Composer 更新

composer require zachflower/indefinite-article
composer update

手动

下载最新版本,解压缩到名为 indefinite-article 的目录中,并在脚本开头包含库

include_once('./indefinite-articles/src/IndefiniteArticle.php');
use \IndefiniteArticle\IndefiniteArticle;

用法

PHP 不定冠词库用于确定单词(a 或 an)之前应使用的不定冠词。为此,只需使用您的单词或短语调用 A() 方法

IndefiniteArticle::A('elephant')

该方法将返回以适当不定冠词为前缀的字符串

an elephant

版权和许可

原始 Perl 模块版权 © 1997-2009 Damian Conway;原始 PHP 转换版权 © 2012 Niko Salminen;当前库版权 © 2016 Zachary Flower;代码在BSD 许可证下发布。