warning: get_headers() [function.get-headers]: This function may only be used against URLs in /var/www/html/myrobotlab/themes/superclean/repoFile.php on line 35.
warning: file_get_contents(//home/beetlejuice/wikiDataFetcher%2BAB%2BFR.py) [function.file-get-contents]: failed to open stream: No such file or directory in /var/www/html/myrobotlab/themes/superclean/repoFile.php on line 38.
WebkitSpeechRecognition interception before programAB
Submitted by moz4r on Tue, 06/14/2016 - 13:42
Hi ! Program AB doesn't like quotes ( ex: I'M A BOT ) it must be ( I M A BOT ) I think
And I want to correct some ear values.
So how can i intercept WebkitSpeechRecognition and replace some characters before ProgramAB read it.
Submitted by beetlejuice on Tue, 06/14/2016 - 23:04.
Hi !
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:
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")