I’m toying with voice recognition right now…
I want to remove the diacritics and accented characters from the voice command string, but I don’t know how…
Surely, the first approach would be to replace all accented characters, but it’s weird.
One other way (Google helped of course) to use the stripAccents method of StringUtils.
But how to use that in a rule?
I have, for example:
14:26:28.160 [INFO ] [pse.smarthome.model.script.Voice.Rec] - VoiceCommand received hello
14:26:28.165 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'VoiceControl': An error occured during the script execution: The name '<XMemberFeatureCallImplCustom>::stripAccents(<XFeatureCallImplCustom>)' cannot be resolved to an item or type.
Any thoughts? I should add that I’m not very skilled at programming in general and java in particular, but I do have the basics
Nope, same error, but thank you @watou
I might have tried that before putting the whole library name in front of “stripAccents”
14:36:59.384 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'VoiceControl': An error occured during the script execution: The name '<XFeatureCallImplCustom>::stripAccents(<XFeatureCallImplCustom>)' cannot be resolved to an item or type.
It may be that org.apache.commons.lang is not in the class path for the script engine. You might try using the source as an example to build your own version in the rule language.