Add initial version of syntax analyser

This commit is contained in:
Aleksey Filippov 2022-01-14 17:07:18 +04:00
parent 608f9c264c
commit 342d78522b
2 changed files with 6 additions and 0 deletions

View File

@ -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__':

3
syntax.py Normal file
View File

@ -0,0 +1,3 @@
class Syntax:
def run(self, text: str) -> str:
return text