summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2023-06-11 13:10:59 +0200
committerHarald Musum <musum@yahooinc.com>2023-06-11 13:10:59 +0200
commitb226cf513893863e06750a8e3d813392cc2ce002 (patch)
tree327f2a4ad11c1acc55db0a3f9d07750d1c36d4b0
parent54be959f7f932282fb6268a77f44ae0135154a1b (diff)
Ignore automata when validating semantic rules
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/SemanticRuleBuilder.java4
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/container/search/semanticrules/rules/common.sr1
2 files changed, 3 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/SemanticRuleBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/SemanticRuleBuilder.java
index 4a295d49a32..4923c41224e 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/SemanticRuleBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/SemanticRuleBuilder.java
@@ -25,7 +25,7 @@ import java.util.Map;
// TODO: Move into SemanticRules
public class SemanticRuleBuilder {
- /** Build the set of semantic rules for an application package and validates them */
+ /** Builds the semantic rules for an application package and validates them */
public SemanticRules build(ApplicationPackage applicationPackage) {
var ruleFiles = applicationPackage.getFiles(ApplicationPackage.RULES_DIR, "sr");
var rules = new SemanticRules(ruleFiles.stream().map(this::toRuleBaseConfigView).toList());
@@ -73,7 +73,7 @@ public class SemanticRuleBuilder {
}
static Map<String, RuleBase> toMap(SemanticRulesConfig config) throws ParseException, IOException {
- RuleImporter ruleImporter = new RuleImporter(config, new SimpleLinguistics());
+ RuleImporter ruleImporter = new RuleImporter(config, true, new SimpleLinguistics());
Map<String, RuleBase> ruleBaseMap = new HashMap<>();
for (SemanticRulesConfig.Rulebase ruleBaseConfig : config.rulebase()) {
RuleBase ruleBase = ruleImporter.importConfig(ruleBaseConfig);
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/search/semanticrules/rules/common.sr b/config-model/src/test/java/com/yahoo/vespa/model/container/search/semanticrules/rules/common.sr
index 3833641a56c..92b279aada4 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/container/search/semanticrules/rules/common.sr
+++ b/config-model/src/test/java/com/yahoo/vespa/model/container/search/semanticrules/rules/common.sr
@@ -1,4 +1,5 @@
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+@automata(etc/vespa/fsa/stopwords.fsa)
## Some test rules
# Spelling correction