From 7442220830b10480b30116649ae7bf08be5255cb Mon Sep 17 00:00:00 2001 From: GiviMAD Date: Sun, 3 Apr 2022 12:14:09 +0200 Subject: [PATCH] [AbstractRuleBasedInterpreter] Fix spanish tokenization (#2889) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miguel Álvarez Díez --- .../openhab/core/voice/text/AbstractRuleBasedInterpreter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/text/AbstractRuleBasedInterpreter.java b/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/text/AbstractRuleBasedInterpreter.java index 734fd36d23..d744f2c91a 100644 --- a/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/text/AbstractRuleBasedInterpreter.java +++ b/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/text/AbstractRuleBasedInterpreter.java @@ -600,7 +600,8 @@ public abstract class AbstractRuleBasedInterpreter implements HumanLanguageInter 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"); + split = text.toLowerCase(locale).replaceAll("[\\']", " ").replaceAll("[^\\w\\sáéíóúïüñç]", " ") + .split("\\s"); } else { split = text.toLowerCase(locale).replaceAll("[\\']", "").replaceAll("[^\\w\\s]", " ").split("\\s"); }