5 kyu
Haiku Checker
181 of 253anter69
Loading description...
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
The lengths that I will go to, to avoid regex...
Thanks for the kata, a nice chance to exercise and practice.
Thanks
You're welcome, keep it going.
According to the paragraph explaining what constitutes as a silent 'E' in this challenge, shouldn't
apple
be one syllable?Isn't it counted as one?
No, had it in one of my randomized test cases and it was 2
(I suppose the language is JS, based on your profile)
I checked the JS tests, and it counts correctly 1 syllable for "apple". If you have such an issue, please copy-paste the whole input and the error message here, so that we can help you better.
In Python, some of the random tests are returning incorrect results. The following below are a handful of example tests that are expecting
True
, but should beFalse
. It appears to affect words that end inyer
, such aslayer
,mayor
, etc. by counting them as one syllable instead of two.The middle line has 8 syllables.
First line has 7 syllables, but 6 per the rules of this kata (consecutive vowels, so
soviet
is counted as2
). Still should returnFalse
.I see the issue:
y
is counted as a vowel, which it sometimes is, and sometimes not. I have to find a way around it... will get to work.But in the meantime, I really like this random haiku you quoted:
What a clever piece of (artificial) intelligence ;-)
Isn't "mayor" one syllable?
I am unsure if it's worth the complications to distinguish when 'y' is a vowel and when it is not. English syllables are not easy; if you want to do it fully correct - well, you can't.
I've always pronounced "mayor" with 2 syllables, but, according to Merriam-Webster, there are two pronunciations (with the 2-syllables being the dominant). Either way, "layer" is not pronounced "lair" (except maybe by the type of people who say "nukular"?).
Agreed here, but in that case, the specifics should be outlined in the Description. Another example is
besides
. The reference solution correctly recognizes that the word is 2 syllables, handling the rule about the silent "E" words even for plurals. But then in that case it would fail with a word such asfixes
.The Description could be improved if there were more detail covering the special cases that are going to be tested in this kata.
...or maybe I will just remove these pesky words from the list! :-)
In fact, I really consider that removing a few words from the word list (e.g.
layer
,mayor
) would be the least painful solution, and would not invalidate current solutions.It looks like the part of a word that has a
y
with adjacent vowels is considered one syllable in the tests, so a word likeyoyo
is regarded as one syllable.I subtracted the "problematic" words from the list in ruby and python. However, I would need some help with JS.
@JohanWiltink
: could you do a simple update to the JS version (if it is a simple- list
or similar)? Here are the list of words to be removed:["anyone", "beyond", "buyer", "employee", "employer", "everyone", "layer", "mayor", "player", "prayer", "taxpayer"]
Thanks
@anter69, I'll leave it up to you and @JohanWiltink to decide when the tests are satisfactory. Feel free to mark this issue resolved at your discretion.
You can't coerce an array into an integer, so you're doing
NaN - NaN
=>NaN
. I'll see if i can fix this, Johan doesn't know Python or Ruby.Uh, I don't have edit access,
Removed the above-mentioned words manually from all languages, closing the issue.
If you still notice problems, please open a new issue.
I didn't get notifications for this thread, so I missed that request. Thanks anter!
(
everyone
? two wrongs seem to make a right there. :Pprayer
? isn't that one syllable? )Let's just skip this ;-)
this is a 6kyu kata.
Wrong forum.
Go bother an admin. They're the only ones who can change that.
LOL
you're still not banned, you cheater...? :/
You are funny.i do it by myself.
yeah, sure, moron...
JavaScript translation
Thanks, approved!
One of the simple test cases in Python has a typo in the input in the word "Python".
Thanks, fixed
Approved ;-)
Thanks! I expected about 6 kyu, but what the heck ;-)
Nice kata! Made me learn a bit more about Regex. :)
Thanks!