From 395ac230a94d753453fe3db23750f275eef77fa5 Mon Sep 17 00:00:00 2001 From: xfnw Date: Sat, 7 Aug 2021 09:16:31 -0400 Subject: [PATCH] increse sentance ending if the sentances are too long automatically --- modules/nlp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/nlp.py b/modules/nlp.py index 51b52a3..290cfec 100644 --- a/modules/nlp.py +++ b/modules/nlp.py @@ -55,6 +55,7 @@ async def genOut(self, noun): end = [ i['word'] for i in shared.db['end'].find() ] nouns = [i['word'] for i in shared.db['noun'].find()] iter=0 + coun=0 out = [noun] while (out[0] not in beg or nouns.count(out[0])-1 > iter * shared.enmul) and iter < 7: try: @@ -62,6 +63,7 @@ async def genOut(self, noun): except IndexError: iter += 69 iter += 1 + coun += 1 iter = 0 while (out[-1] not in end or nouns.count(out[-1])-1 > iter * shared.enmul) and iter < 7: @@ -70,6 +72,9 @@ async def genOut(self, noun): except IndexError: iter += 69 iter += 1 + coun += 1 + if coun >= 14: + shared.enmul += 1 return out