Here is a quick exemple ( mayby not the better, but that work ! )
Runtime.createAndStart("chatBot","ProgramAB")
sleep (1)
chatBot.startSession("default","wikidataFR")
Runtime.createAndStart("ear","WebkitSpeechRecognition")
mouth=Runtime.createAndStart("mouth","AcapelaSpeech")
htmlFilter=Runtime.createAndStart("htmlFilter","HtmlFilter")
sleep(1)
ear.addListener("publishText", python.name,"talk")# Add route from Program AB to html filter
chatBot.addTextListener(htmlFilter)# Add route from html filter to mouth
htmlFilter.addListener("publishText", python.name,"say");
mouth.setLanguage("FR");
mouth.setVoice("Antoine");
ear.setLanguage("fr-FR")
Runtime.createAndStart("webGui","WebGui")def say(data):
mouth.speakBlocking(data)print"chatbot :", data
def talk(data):if data!="":
data = data.replace("\'"," ")# Replace quote by a blank space
chatBot.getResponse(data)# Ask the chatBot print"chatbot :", data
Hi !Here is a quick exemple
Hi !
Here is a quick exemple ( mayby not the better, but that work ! )
You need to have this category in your aiml file.
But ProgramAB work with
But ProgramAB work with quotes, you have to use UTF-8, have a look here:
[[/home/beetlejuice/wikiDataFetcher%2BAB%2BFR.py]]
merci beetle !!!! I will try
merci beetle !!!!
I will try it
Correct me if i wrong but It
Correct me if i wrong but It works but not really :) , why :
QUEL EST LE fruit DE L'abricotier
the paterne called is :
<category><pattern>QUEL EST LE * DE *</pattern>
AND NOT
<category><pattern>QUEL EST LE * DE L'*</pattern>
I want to use this outside the wikidata service in classic aiml pattern
So the talk function is not called at this time. I need to intercept the data before ProgramAB fetch it . Any idea ?
I foundt it
this is the tip : ( remove chatbot listener )
#ear.addTextListener(chatBot)
def onText(text):
print text.replace("'", " ")
chatBot.getResponse(text.replace("'", " "))
python.subscribe(ear.getName(),"publishText")