Bug fixes for word scoring
This commit is contained in:
parent
5246008861
commit
7d44bfad19
|
@ -52,7 +52,7 @@ actions = [
|
|||
},
|
||||
{
|
||||
"type": "response",
|
||||
"pattern": "/hm+/",
|
||||
"pattern": "/.^[^!]*hm+/",
|
||||
"callback": score_word("hmm", "hm+")
|
||||
},
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ actions = [
|
|||
},
|
||||
{
|
||||
"type": "response",
|
||||
"pattern": "/o+f/",
|
||||
"pattern": "/^[^!]*o+f/",
|
||||
"callback": score_word("oof", "o+f")
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ def score_word(word, regex):
|
|||
check = response.lower().strip()
|
||||
|
||||
botnick = self.bot.botnick
|
||||
pattern = re.compile(regex)#"hm+")
|
||||
pattern = re.compile(regex)
|
||||
matches = re.findall(pattern, check)
|
||||
maximum = 10
|
||||
score = len(matches) if len(matches) <= maximum else maximum
|
||||
|
|
Loading…
Reference in New Issue