Simple example to change languages

GroG

8 years 2 months ago

Great work Jens,

You mixed three languages in on set of aiml files, so theoretically it could just grow and grow.  
Do you see pros or cons in mixing ?  vs have 3 different sets ?   A pro would seem that your bot is multi-lingual without configuration adjustment (except for that switching webkitrecognizer) ...

I'm also wondering how the backend voices were switched - did you switch voices the first time you asked?  Any other modifications?  

Kwatters pointed out a library which is used to identify a language from text.  
This theoretically could be hooked up, and all the text from webkit could be passed through - it could change the voice automatically, but we still have the problem of the manual flip of webkit ... hmmmm

Yes, in this example all language categories are inside one aiml-file. Of course it would be better to separate the languages, like german.aiml/english.aiml/italian.aiml. ProgramAB will load all aiml files anyway for each session.

The voices switch when I ask "do you speak english". Here I use a oob-tag to call a def in python, like:

def CTG():
    for voice in voices:
        acapelaSpeech.setVoice("Klaus")  # this sets to voice to german

Would be nice if we could have an automatic change of the language using the webkit.