diff --git a/src/service/NaturalLanguageUnderstanding.py b/src/service/NaturalLanguageUnderstanding.py new file mode 100644 index 0000000..96ae838 --- /dev/null +++ b/src/service/NaturalLanguageUnderstanding.py @@ -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(word in self.dictionary): + frame+=self.dictionary[word]+"&" + return frame[0:-1] + + +naturalLanguageUnderstanding = NaturalLanguageUnderstanding() +print(naturalLanguageUnderstanding.convertTextToFrame("Cześć, jak masz na imię?")) \ No newline at end of file