Skip to content

Commit

Permalink
[AbstractRuleBasedInterpreter] Fix spanish tokenization (openhab#2889)
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
GitOrigin-RevId: 7442220
  • Loading branch information
GiviMAD authored and splatch committed Jul 12, 2023
1 parent 1f5284b commit 27df5ad
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ protected List<String> tokenize(Locale locale, @Nullable String text) {
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");
}
Expand Down

0 comments on commit 27df5ad

Please sign in to comment.