Hacker News new | ask | show | jobs
by horsawlarway 378 days ago
Sometimes.

Which is actually part of why I clicked into the article - I expected it to get into the complexity of trying to detect if 'y' was a vowel as part of the search, and instead got a mostly banal python text search article.

You can see the technical rules for when 'Y' is a vowel in english here:

https://www.merriam-webster.com/grammar/why-y-is-sometimes-a...

Y is considered to be a vowel if…

The word has no other vowel: gym, my.

The letter is at the end of a word or syllable: candy, deny, bicycle, acrylic.

The letter is in the middle of a syllable: system, borborygmus.

1 comments

I dunno about those rules; there are exceptions. Yttrium. Yggdrasil. Probably others, but those from off the top of my head.

I think the best way to define when Y is a vowel is when it's not a consonant. Basically, if you make the sound that Y represents in the word "yes", it's a consonant. Otherwise, it's a vowel. (At least, no exceptions come to mind.)

Wow, how would you code that?!
Heh, good question. I’d probably use a heuristic like what’s discussed in this thread and hope that it works. :D