Indeed. My understanding is that the usage of a/an depends on the
pronunciation of the next word. In the case of unicorn, it sounds like
it begins with a "you", hence "a unicorn"

on the flip side, consider the phrase "I'll be there in an hour",
silent 'h' so we use "an hour"

So this very general regex will be enough for most cases, but wont
solve the problem at hand entirely.

On Mon, Nov 7, 2011 at 9:27 AM, Hassan Schroeder
<hassan.schroeder / gmail.com> wrote:
> On Sun, Nov 6, 2011 at 12:59 PM, steve ross <cwdinfo / gmail.com> wrote:
>
>> def article_for(noun)
>>    忨۰ݧ >> #{article} #{noun}"
>> end
>>
>> irb(main):022:0> article_for 'dog'
>> => "a dog"
>> irb(main):023:0> article_for 'animal'
>> => "an animal"
>
>> article_for 'unicorn'
> > "an unicorn"  => oops :-)
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder / gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan
>
>