From 7d7d73c6d5a285868c66a95ffa14c9a78cbcb403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81lvarez?= Date: Tue, 5 Dec 2023 23:34:53 +0100 Subject: [PATCH] apply pr review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miguel Álvarez --- .../text/AbstractRuleBasedInterpreter.java | 24 ++++++------------- .../resources/LanguageSupport_es.properties | 2 +- 2 files changed, 8 insertions(+), 18 deletions(-) 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 4018f01c828..56629db8756 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 @@ -476,10 +476,8 @@ public InterpretationResult interpretAST(ResourceBundle language, ASTNode node, } /** - * Creates an item rule which two dynamic capture values on base of a head, a middle and an optional tail - * expression, - * where one of the values is an item - * name expression and the other a free captured value. + * Creates an item rule which two dynamic capture values on base of a head a middle and an optional tail expression, + * where one of the values is an item name expression and the other a free captured value. * Rule will be restricted by the provided filter. * * @param item Item registering the rule. @@ -524,11 +522,8 @@ public InterpretationResult interpretAST(ResourceBundle language, ASTNode node, } /** - * Creates a custom rule on base of a head and a tail expression, where the middle part of the new rule's - * expression - * will consist of a free command to be captured. Either the head expression or the tail expression should contain - * at least one {@link #cmd} - * generated expression. + * Creates a custom rule on base of a head and a tail expression, + * where the middle part of the new rule's expression will consist of a free command to be captured. * Rule will be restricted to the provided item name. * * @param item Item target @@ -541,7 +536,6 @@ protected Rule customDynamicRule(Item item, ItemFilter itemFilter, Object headEx Expression tail = exp(tailExpression); Expression expression = tail == null ? seq(headExpression, value(null)) : seq(headExpression, value(tail), tail); - HashMap valuesByLabel = getItemValuesByLabel(item); return new Rule(expression, itemFilter, isSilent) { @Override @@ -586,14 +580,10 @@ private HashMap getItemValuesByLabel(Item item) { } /** - * Creates a custom rule on base of a head and a tail expression, where the middle part of the new rule's - * expression - * will consist of a free command to be captured. Either the head expression or the tail expression should contain - * at least one {@link #cmd} - * generated expression. - * Rule will be restricted to the provided item name. + * Creates a custom rule on base of a expression. + * The expression should contain at least one {@link #cmd} generated expression. * - * @param itemFilter Filters the allowed items + * @param itemFilter Filters the allowed items. * @param cmdExpression The expression. * @return The created rule. */ diff --git a/bundles/org.openhab.core.voice/src/main/resources/LanguageSupport_es.properties b/bundles/org.openhab.core.voice/src/main/resources/LanguageSupport_es.properties index 2b6fc783517..7dae358458e 100644 --- a/bundles/org.openhab.core.voice/src/main/resources/LanguageSupport_es.properties +++ b/bundles/org.openhab.core.voice/src/main/resources/LanguageSupport_es.properties @@ -1,4 +1,4 @@ -ok = Okey. +ok = Ok. sorry = Lo siento, no lo he entendido. error = Lo sentimos, hubo un error inesperado. multiple_objects = Hay más de un objeto con un nombre similar.