Closed marcinciarka closed 8 years ago
I did not even know that Cleverbot has multi language support. I will need to investigate this one.
Cleverbot speaks many languages. When I write in polish on the website he always responds in polish, but through the api it does polish/english, sometimes german.
Im counting on you, thanks for great api :)
I've played a little with the Java version, and made it works.
The latest java 1.4.0-SNAPSHOT version (this is a snapshot release only) now accepts an array of Locale that controls the languages the bot should respond into.
If I get good feedbacks with this, I will migrate the .NET, PHP and Python versions too.
Is there any chance to move this to PHP?
Yeah, I will take some time for this. I do not know exactly how I will do it though. Maybe make ChatterBot.createSession take an optional array of Locale ?
Ok, here it is, this commit allows one to pass a string to createSession
to change de default language.
So now you can do something like this:
$factory = new ChatterBotFactory();
$bot1 = $factory->create(ChatterBotType::CLEVERBOT);
$bot1session = $bot1->createSession('fr-CA'); // for canadian french
This new param, is straight added as an Accept-Language header
So, have a look at the Language Tags spec for the valid values you can use.
It feels like a hack, please test it and/or submit a PR to help me make this less smelly ;)
I tried adding header
Accept-Language:
to fopen, but it doesnt work.