Dodanie makiety analizatora języka naturalnego

This commit is contained in:
s495728 2024-04-30 23:08:28 +02:00
parent cc74e9e838
commit aa1b9cf66b

View File

@ -0,0 +1,18 @@
class NaturalLanguageUnderstanding:
dictionary = {
"Cześć," : "welcomemsg()",
"imię?" : "request(name)"
}
def convertTextToFrame(self, text: str):
frame = ""
text = text.split(" ")
for word in text:
if frame == "":
if(word in self.dictionary):
frame+=self.dictionary[word]
else:
if(word in self.dictionary):
frame+="&"+self.dictionary[word]
return frame