Programmatically determine whether to describe an object with "a" or "an"?

Posted by MarathonStudios on Stack Overflow See other posts from Stack Overflow or by MarathonStudios
Published on 2010-12-29T22:29:49Z Indexed on 2010/12/29 22:54 UTC
Read the original article Hit count: 160

Filed under:

I have a database of nouns (ex "house", "exclamation point", "apple") that I need to output and describe in my application. It's hard to put together a natural-sounding sentence to describe an item without using "a" or "an" - "a house is BIG", "an exclamation point is SMALL", etc.

Is there any function, library, or hack i can use in PHP to determine whether it is more appropriate to describe any given noun with A or AN?

© Stack Overflow or respective owner

Related posts about php