-1
Challenge
Joe the rapper is struggling with rhyming words in his lyrics. He needs your help.
For this situation, we will use rhymes where the last syllable in a word is the same as the other word (spelled the same).
When Joe inputs a word, the program will read a list of words from a file and output those that rhyme with Joe's word.
To show that the program works, we will only need to use a small list.
txt File:
hello
joe
crew
flow
time
apple
heart
glow
rhyme
art
jello
grew
doe
flue
blow
smart
dime
cat
slime
show
bedtime
clue
grime
toe
dart
cart
brew
snow
prime
hat
chart
lime
blue
knew
lunchtime
restart
Examples
Input: snow
Output: blow flow glow show
Note- Should not output the input
Input: fart
Output: restart art dart cart chart smart heart
Note- Should work for inputs not in list
Input: crime
Output: time slime prime grime dime lime bedtime lunchtime
Note- Should work for all syllables
Rules
Should output all words that rhyme with input
does not need to output rhymes with different letters Ex:
Crime
should not outputrhyme
Should not output the input
- Should work with inputs not in the list
- Should work will all syllables
Shortest Bytes Wins!
1Define "rhyme". Does "bedtime" rhyme with "clue"? – Leaky Nun – 2016-05-20T09:11:32.120
See comments on http://meta.codegolf.stackexchange.com/a/7014/194 for a suggestion as to how to make "rhyme" well-specified.
– Peter Taylor – 2016-05-20T10:30:30.837@Peter I think JoshK is looking for something simpler than phonetic rhyming.
does not need to output rhymes with differet letters
andsnow
-->blow flow glow show
(but nottoe
) Anyway, Josh, a proper definition is required. Given examples follow the rule of last vowel and all consonants after it (this works forchart & heart
but would fail forchat & heat
.) As shown by Kenny Lau's example, matching the whole of the last vowel cluster (and any following consonants) may be better but would makeheart
invalid. Voting to close until resolved. (personally I'd get rid ofheart
) – Level River St – 2016-05-20T10:52:40.750As you haven't been here that long, I'll point out that the reason for close voting is nothing personal, it's to temporarily stop the posting of answers before the rules have been fully clarified (as is happening right now.) You could try posting your next challeng in the sandbox for feedback first before posting on the main site http://meta.codegolf.stackexchange.com/q/2140/15599
– Level River St – 2016-05-20T10:57:08.257Do
though
,through
, andrough
rhyme? – mbomb007 – 2016-05-20T19:12:21.603