A little pedantic, but: this will tell you if a poem is shaped like the common English conception of a haiku, but it won't tell you if this is a haiku, because a haiku is more than just counting syllables.
Aside from the fact that "syllables" is not exactly the unit being counted in haiku, there are also considerations of theme, tone, and a sort of "open-ended-ness" – among other considerations.
Plus the translation issues, where you can have an absolute sledgehammer of a haiku that would need to be watered down in order fit the "correct" meter in English:
in kyoto / hearing the cry of the cuckoo / i long for kyoto
Super fun idea! That syllables package might not be robust enough for this purpose. Even in its documentation's super simple code samples, it estimates the word estimate wrong haha. I think that's somewhat meant to be an admission by the author that it is an estimate.
>>> import syllables
>>> syllables.estimate('estimate')
4
Doesn't matter in the context of making a fun web app though, cool idea!
A little flask app to write and validate haikus. It's definitely not perfect and makes some mistakes. It uses the syllables python library to estimate how many syllables are in each word.
You can check the override list at https://haikuvalidator.com/overrides and if you have any suggestions feel free to let me know any words that are broken.
This is my first time making a web app. Hoping that someone finds it fun / useful.
Very cool! I like the interface. For anyone interested in this and similar ideas, haiku/senryū detection is a feature of this old project of mine: https://versepad.com
It's also not limited to words pronounced poetically. Some words where both variants are common, like "wicked", have different numbers of syllables depending on meaning. e.g.
Beads of sweat wicked through
the wicked witch's black robes
a hot summer day
See, e.g., Bashō's crow haiku, arguably one of the genre-defining poems [0]. Plus, English is on average terser than Japanese; I've read somewhere that, in English, 3-5-3 syllables pack roughly the same amount of content as the Japanese 5-7-5.
AFAICT metric sillables basically count the vowel sounds so service is two and chocolate is two or thre: "ser-vis" (ˈsɜːvɪs) and "chok-lait" or "cho-ko-lait" (ˈʧɔklət or ˈʧɔkolət).
Aside from the fact that "syllables" is not exactly the unit being counted in haiku, there are also considerations of theme, tone, and a sort of "open-ended-ness" – among other considerations.
This article served as my introduction to the actual complexities of haiku: https://forgottenpoets.substack.com/p/haiku-thursdays-one-pl...