From 342d78522b1e14af203b1081a1b8950da018f551 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Fri, 14 Jan 2022 17:07:18 +0400 Subject: [PATCH] Add initial version of syntax analyser --- main.py | 3 +++ syntax.py | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 syntax.py diff --git a/main.py b/main.py index 2ea47b7..00a8b99 100644 --- a/main.py +++ b/main.py @@ -4,6 +4,7 @@ import sys import warnings from speech import Speech +from syntax import Syntax if not sys.warnoptions: warnings.simplefilter("ignore") @@ -17,6 +18,8 @@ def _main(): speech_server = 'http://vosk.athene.tech' text = Speech().run(wav_file, speech_server) print(f'Text: {text}') + parse_tree = Syntax().run(text) + print(f'Parse tree: {parse_tree}') if __name__ == '__main__': diff --git a/syntax.py b/syntax.py new file mode 100644 index 0000000..52a52a2 --- /dev/null +++ b/syntax.py @@ -0,0 +1,3 @@ +class Syntax: + def run(self, text: str) -> str: + return text