add punctuation removing

This commit is contained in:
Olga Kwoczak 2023-05-04 16:31:38 +02:00
parent 54f71c15ff
commit 3da2fb8aad

View File

@ -34,7 +34,14 @@ def nlu(utterance):
utterance = 'jakie napoje gazowane'.lower() utterance = 'jakie, napoje gazowane'.lower()
punctuation = '''!;:/?,.'''
for i in utterance:
if i in punctuation:
utterance = utterance.replace(i, "")
matched = book_grammar.find_matching_rules(utterance) matched = book_grammar.find_matching_rules(utterance)
print(matched) print(matched)