add limerick functionaliteit #5 #39

Merged
mark merged 3 commits from limericks into master 2026-10-24 23:14:55 +02:00
Showing only changes of commit 65088fc69d - Show all commits
+4 -6
View File
2
@@ -483,13 +483,11 @@ class Chatbot(commands.Cog):
rf"{V}+$", #staand rijm op V: moe, koe rf"{V}+$", #staand rijm op V: moe, koe
] ]
ending = ""
for pattern in rijmelarij: for pattern in rijmelarij:
for match in re.finditer(pattern, word): match = re.search(pattern, word)
ending = word[match.start():match.end()] if match and match.group():
if ending: return match.group()
break return word[-1] #niks rijmt op: brrr, zzz, pssjt. indexeren op laatste letter.
return ending or word[-1] #niks rijmt op: brrr, zzz, pssjt. indexeren op laatste letter.
guus marked this conversation as resolved
Review

whitespace

whitespace
# Genereert een rijmwoordenboek zodat je niet hoeft te hopen dat je loopje eindelijk # Genereert een rijmwoordenboek zodat je niet hoeft te hopen dat je loopje eindelijk
# de juiste combinatie van aantal lettergrepen + rijmuitgang genereert na 200 tries. # de juiste combinatie van aantal lettergrepen + rijmuitgang genereert na 200 tries.
10