[standardinterpreter] spanish: fix text tokenization and on/off rule (#2826)

Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
pull/2832/head
GiviMAD 2022-03-09 09:02:06 +01:00 committed by GitHub
parent 11c0ed53d0
commit f0664b3a0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -261,7 +261,7 @@ public class StandardInterpreter extends AbstractRuleBasedInterpreter {
/* OnOffType */
itemRule(seq(encenderApagar, articulo), /* item */ onOff),
itemRule(seq(encenderApagar, articulo)/* item */),
/* IncreaseDecreaseType */

View File

@ -599,6 +599,8 @@ public abstract class AbstractRuleBasedInterpreter implements HumanLanguageInter
if (Locale.FRENCH.getLanguage().equalsIgnoreCase(locale.getLanguage())) {
split = text.toLowerCase(locale).replaceAll("[\\']", " ").replaceAll("[^\\w\\sàâäçéèêëîïôùûü]", " ")
.split("\\s");
} else if ("es".equalsIgnoreCase(locale.getLanguage())) {
split = text.toLowerCase(locale).replaceAll("[\\']", " ").replaceAll("[^\\w\\sáéíóúü]", " ").split("\\s");
} else {
split = text.toLowerCase(locale).replaceAll("[\\']", "").replaceAll("[^\\w\\s]", " ").split("\\s");
}