add limerick functionaliteit #5 #39
+4
-6
@@ -483,13 +483,11 @@ class Chatbot(commands.Cog):
|
||||
rf"{V}+$", #staand rijm op V: moe, koe
|
||||
]
|
||||
|
||||
ending = ""
|
||||
for pattern in rijmelarij:
|
||||
for match in re.finditer(pattern, word):
|
||||
ending = word[match.start():match.end()]
|
||||
if ending:
|
||||
break
|
||||
return ending or word[-1] #niks rijmt op: brrr, zzz, pssjt. indexeren op laatste letter.
|
||||
match = re.search(pattern, word)
|
||||
if match and match.group():
|
||||
return match.group()
|
||||
return word[-1] #niks rijmt op: brrr, zzz, pssjt. indexeren op laatste letter.
|
||||
|
||||
|
guus marked this conversation as resolved
|
||||
# Genereert een rijmwoordenboek zodat je niet hoeft te hopen dat je loopje eindelijk
|
||||
# de juiste combinatie van aantal lettergrepen + rijmuitgang genereert na 200 tries.
|
||||
|
||||
Reference in new issue
Block a user
whitespace