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:
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.)
It depends on the word, and possibly even on dialect. There isn’t a 1:1 mapping between characters and vowels. Vowels are fundamentally a phonetic concept, not a graphemic one.
This is also why Unicode doesn’t have a “vowel” character property. Otherwise you could use a regex like `\p{Vowel}`.
Yes, this is true. Many people seem to think of words as written text and not as spoken words, so they focus on analyzing the characters is a word and not how it sounds.
I had a linguistics professor say something like “Writing is parasitic on speech”
TIL: When y forms a diphthong—two vowel sounds joined in one syllable to form one speech sound, such as the "oy" in toy, "ay" in day, and "ey" in monkey—it is also regarded as a vowel. Typically, y represents a consonant when it starts off a word or syllable, as in yard, lawyer, or beyond.
In English it is pretty much unpredictable whether Y is a vowel or a consonant.
While for older English words there is a complex set of rules mentioned by another poster for determining whether Y is a vowel, as mentioned by yet another poster, English also includes more recent borrowings from languages with other spelling rules for Y.
At its origin, Y was a vowel, not a consonant. It was added to the Latin alphabet for writing the front rounded vowel that is written "ü" in German, "u" in French or "y" in Scandinavian languages.
It is very unfortunate that in English, and in some other languages that have followed English, Y has been reassigned to write consonant "i". This has created a lot of problems due to the mismatches between the spelling rules of different languages. The rule that is most consistent with the older usage would have been to use J for consonant "i", like in German and other languages inspired by it. However in many Romance languages the pronunciation of consonant "i" has changed in time, leading to other 3 phonetic values for the letter J, like in English (i.e. Old French), like in French/Portuguese and like in Spanish.
So the result is that both for Y and for J there are great differences in pronunciation between the European languages, and the many words using such letters that have been borrowed between languages create a lot of complexity in spelling rules.