From c167c4b430205e0be6056a457b7f671a6ec7e440 Mon Sep 17 00:00:00 2001 From: MarkParker5 Date: Sat, 17 Apr 2021 23:49:07 +0300 Subject: [PATCH] append few bool synonyms --- Command/Command.py | 4 ++-- Raspi/gitpull.py | 1 + synonyms.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Command/Command.py b/Command/Command.py index f45d675..89ef45f 100644 --- a/Command/Command.py +++ b/Command/Command.py @@ -53,8 +53,8 @@ class Command(ABC): 'num': lambda: r'[0-9]+', 'quest' : lambda: Command.compilePattern('(кто|что|как|какой|какая|какое|где|зачем|почему|сколько|чей|куда|когда)'), 'repeat': lambda: Command.compilePattern('* ((повтор*)|(еще раз)|(еще*раз)*) *'), - 'true': lambda: Command.compilePattern('('+'|'.join(sysonyms.get('да'))+')'), - 'false': lambda: Command.compilePattern('('+'|'.join(sysonyms.get('нет'))+')'), + 'true': lambda: Command.compilePattern('('+'|'.join(synonyms.get('да'))+')'), + 'false': lambda: Command.compilePattern('('+'|'.join(synonyms.get('нет'))+')'), 'bool': lambda: Command.compilePattern('($true|$false)') } _regex = { diff --git a/Raspi/gitpull.py b/Raspi/gitpull.py index cecb353..081f962 100644 --- a/Raspi/gitpull.py +++ b/Raspi/gitpull.py @@ -16,6 +16,7 @@ def method(params, finish_event): os.system('git -C '+config.path+' remote update') if not 'git pull' in os.popen('git -C '+config.path+' status -uno').read(): finish_event.set() + voice = text = 'Установлена последняя версия' return Response(text = text, voice = voice) os.system('git -C '+config.path+' pull') finish_event.set() diff --git a/synonyms.py b/synonyms.py index 5a1695a..6d4e2b4 100644 --- a/synonyms.py +++ b/synonyms.py @@ -1,4 +1,4 @@ synonyms = { - 'да': 'да', - 'нет': 'нет', + 'да': ['да', 'конечно', 'ествественно'], + 'нет': ['нет', 'не надо', 'отмена', 'отставить'], }