Do Main.py and NaturalLanguageAnalyzer.py

This commit is contained in:
PawelDopierala 2024-04-17 19:35:47 +02:00
parent 2f9b63866a
commit 8009b2a7c4
2 changed files with 13 additions and 0 deletions

7
Main.py Normal file
View File

@ -0,0 +1,7 @@
from NaturalLanguageAnalyzer import NaturalLanguageAnalyzer
if __name__ == "__main__":
text = "Cześć, jak masz na imię?"
nla = NaturalLanguageAnalyzer()
user_act = nla.process(text)
print(user_act)

View File

@ -0,0 +1,6 @@
class NaturalLanguageAnalyzer:
def process(self, text):
user_act = None
if ("imie" in text or "imię" in text) and "?" in text:
user_act = "request(firstname)"
return user_act