Compare commits

..

No commits in common. "2a21330e8b605f3db6cff604b7bd5fee343ce22a" and "a886b95db669e1b97babc724a09c424512ad29d0" have entirely different histories.

View file

@ -19,7 +19,7 @@ async def rec(self, m):
beg = shared.db["beg"]
end = shared.db["end"]
words = re.sub(r"([\.,\?!])", r" \1", m).split()
words = m.split()
if words[0] == "admin" or len(words) < 2:
return
@ -78,7 +78,7 @@ async def genOut(self, noun):
out = [noun]
while (
beg.find_one(word=out[0]) is None
or beg.count(word=out[0]) - 1 < shared.enmul / (1 + iter / shared.maxiter)
or beg.count(word=out[0]) - 1 > iter * shared.enmul
) and iter < shared.maxiter:
try:
out = [
@ -95,13 +95,13 @@ async def genOut(self, noun):
try:
out = [random.choice(list(prew.find(pro=out[0])))["pre"]] + out
except IndexError:
iter += 69420
iter += 69
iter += 1
coun += 1
iter = 0
while (
end.find_one(word=out[-1]) is None
or end.count(word=out[-1]) - 1 < shared.enmul / (1 + iter / shared.maxiter)
or end.count(word=out[-1]) - 1 > iter * shared.enmul
) and iter < shared.maxiter:
try:
out.append(
@ -118,14 +118,14 @@ async def genOut(self, noun):
try:
out.append(random.choice(list(prew.find(pre=out[-1])))["pro"])
except IndexError:
iter += 69420
iter += 69
iter += 1
coun += 1
if coun <= 4:
shared.enmul += 1
shared.enmul -= 0.1
elif coun >= shared.maxiter:
shared.enmul -= 1
shared.enmul += 0.1
return out
@ -171,10 +171,10 @@ async def init(self):
# delay between grabbing random messages and passively
# learning.
shared.learndelay = 1
# sentance ending weight, higher means longer sentances,
# sentance ending weight, lower means longer sentances,
# higher means shorter sentances. this will need to slowly
# get larger as the database grows
shared.enmul = 200
shared.enmul = 2
shared.maxiter = 14
shared.rawm["nlp"] = filter