PHP library to look up information about words
Clone or download
DivineOmega Merge pull request #4 from peter279k/issue_#3
Add type hint with PHPDoc comment annotation style
Latest commit 570c19e Dec 9, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Accept request chnages for modifing comments Dec 9, 2018
tests/Unit Test enhancement Sep 15, 2018
.coveralls.yml Coveralls integration Jan 26, 2018
.gitignore Add composer file Jan 25, 2018
.travis.yml Test enhancement Sep 15, 2018
LICENSE Initial commit Jan 25, 2018
README.md Merge branch 'master' of https://github.com/DivineOmega/php-word-info Feb 13, 2018
composer.json Test enhancement Sep 15, 2018
phpunit.xml Add coverage whitelist Jan 26, 2018

README.md

PHP Word Info

Build Status Coverage Status StyleCI

This PHP library can be used to look up information about a word, including the following.

  • Rhymes
  • Half rhymes
  • Number of syllables
  • Offensive or not
  • Portmanteaus
  • Plural / singular

Installation

PHP Word Info can be easily installed using Composer. Just run the following command from the root of your project.

composer require divineomega/php-word-info

If you have never used the Composer dependency manager before, head to the Composer website for more information on how to get started.

Usage

To use PHP Word Info, you must first create a new Word object. You can then call any of the Word object methods, as shown below.

$word = new Word('cat');

$rhymes = $word->rhymes();
$halfRhymes = $word->halfRhymes();
$portmanteaus = $word->portmanteaus();

$numberOfSyllables = $word->syllables();    // Returns an integer
$isOffensive = $word->offensive();          // Returns true/false
$plural = $word->plural();                  // Returns `Word` object
$singular = $word->singular();              // Returns `Word` object

Most methods will return an array of Word objects, unless specified otherwise.