pad punctuation

This commit is contained in:
xfnw 2021-07-26 12:51:02 -04:00
parent 4082705d59
commit 11fca28940

View file

@ -1,8 +1,6 @@
from bot import * from bot import *
import dataset import dataset, random, time, re
import random
import time
async def rec(self, m): async def rec(self, m):
prew = shared.db['prew'] prew = shared.db['prew']
@ -94,7 +92,7 @@ async def filter(self, c, n, m):
async def go(self, c, n, m): async def go(self, c, n, m):
await rec(self, m) await rec(self, m)
words = m.split(' ') words = re.sub(r'([\.,\?!])', r' \1', m).split()
if words[0] == 'admin': if words[0] == 'admin':
return return
await self.message(c, ' '.join(await genOut(self, await getNoun(self, words, c)))) await self.message(c, ' '.join(await genOut(self, await getNoun(self, words, c))))
@ -110,7 +108,7 @@ async def init(self):
# sentance ending weight, lower means longer sentances, # sentance ending weight, lower means longer sentances,
# higher means shorter sentances. this will need to slowly # higher means shorter sentances. this will need to slowly
# get larger as the database grows # get larger as the database grows
shared.enmul = 7 shared.enmul = 6
shared.rawm['nlp'] = filter shared.rawm['nlp'] = filter