UPDATE: I have renamed this class HGrammar to prevent any conflict.
This extension is a simple helper class which I use to make sure text generated by my application is natural.
Plurals - no need to put bracket(s) after your word(s). Lists - produce a nice, simple and clean list from an array. Vowels - Words beginning with a vowel are prefixed with a/an.
protected/componentsor I actually use
[php] // PLURALS echo HGrammar::plural($commentCount,'comment'); // Output: 'comment' if commentCount is 1, otherwise 'comments' // LISTS $people = array('John','Trevor','Qiang'); echo HGrammar::commaList($people); // Output: 'John, Trevor and Qiang'. See PHPDoc for Vowels function