This commit is contained in:
REDNBLACK 2017-09-21 00:27:07 +03:00
parent 445a32f6a2
commit 251ccfdeca
3 changed files with 3 additions and 4 deletions

View File

@ -17,7 +17,7 @@ stop_word=\x00
max_wrds=30
max_msgs=5
endsen=.....!!?
garbage=«<{([.!?;\-—"/*&^#$|#$%^&*(№;%:?*])}>»
garbage=«<{([.!?;\-—"/*&^#$|#$^&*(№;:?*])}>»
garbage_entities=mention,text_mention,bot_command,url,email
[media_checker]

View File

@ -6,7 +6,7 @@ class TrigramRepository(RedisRepository):
def __init__(self):
RedisRepository.__init__(self, source_name='trigrams:{}:{}')
self.counter_source = 'trigrams:count:{}'
self.separator = config['grammar']['separator']
self.separator = config['grammar']['sep']
self.stop_word = config['grammar']['stop_word']
def store(self, chat_id, trigrams):

View File

@ -89,8 +89,7 @@ class ReplyGenerator:
for _ in range(self.max_wrds):
words = key.split(self.sep)
# Исправил ошибку тут !!!!!!
gen_words.append(words[0] if len(gen_words) == 0 else words[1])
gen_words.append(words[1])
next_word = self.trigram_repository.get_random_reply(chat_id, key)
if next_word is None: