Remove spec symbols

This commit is contained in:
Aleksey Filippov 2023-05-31 00:05:00 +04:00
parent 9d72c466da
commit 0a8e192789

View File

@ -1,3 +1,4 @@
import re
from typing import Final
import requests
@ -7,6 +8,7 @@ from src.parse_tree.parse_tree import ParseTree
class Syntax:
__server: Final[str] = 'http://syntaxnet.athene.tech'
__regex = re.compile('[^a-zA-Zа-яА-Я ]')
def __parsey(self, text):
print(f'Connecting to \'{self.__server}\'...')
@ -23,4 +25,5 @@ class Syntax:
return result
def get_parse_tree(self, text: str) -> ParseTree:
return ParseTree(self.__parsey(text))
prepared_text: str = self.__regex.sub('', str(text))
return ParseTree(self.__parsey(prepared_text))