This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-468
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-468 by this push:
new c139e9f WIP.
c139e9f is described below
commit c139e9f723184843d59c405f02fba4e0d599a0b9
Author: Sergey Kamov <[email protected]>
AuthorDate: Wed Oct 13 09:27:00 2021 +0300
WIP.
---
...impleWordsDetector.java => NCConfiguredWordsDetector.java} | 4 ++--
nlpcraft/src/test/java/org/apache/nlpcraft/NCSpec.java | 11 ++---------
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/components/detectors/NCSimpleWordsDetector.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/components/detectors/NCConfiguredWordsDetector.java
similarity index 92%
rename from
nlpcraft/src/main/scala/org/apache/nlpcraft/model/components/detectors/NCSimpleWordsDetector.java
rename to
nlpcraft/src/main/scala/org/apache/nlpcraft/model/components/detectors/NCConfiguredWordsDetector.java
index 427a10b..100aa3a 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/components/detectors/NCSimpleWordsDetector.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/components/detectors/NCConfiguredWordsDetector.java
@@ -30,10 +30,10 @@ import java.util.stream.Collectors;
/**
*
*/
-public class NCSimpleWordsDetector implements NCNlpWordsDetector {
+public class NCConfiguredWordsDetector implements NCNlpWordsDetector {
private final Set<String> words;
- public NCSimpleWordsDetector(Set<String> words) {
+ public NCConfiguredWordsDetector(Set<String> words) {
this.words = words == null ? Collections.emptySet() : words;
}
diff --git a/nlpcraft/src/test/java/org/apache/nlpcraft/NCSpec.java
b/nlpcraft/src/test/java/org/apache/nlpcraft/NCSpec.java
index e14a149..f494cdf 100644
--- a/nlpcraft/src/test/java/org/apache/nlpcraft/NCSpec.java
+++ b/nlpcraft/src/test/java/org/apache/nlpcraft/NCSpec.java
@@ -22,11 +22,10 @@ import org.apache.nlpcraft.model.NCModel;
import org.apache.nlpcraft.model.NCModelBehaviour;
import org.apache.nlpcraft.model.NCRejection;
import org.apache.nlpcraft.model.NCModelConfig;
-import org.apache.nlpcraft.model.NCRequest;
import org.apache.nlpcraft.model.NCResult;
import org.apache.nlpcraft.model.builders.NCModelConfigBuilder;
import
org.apache.nlpcraft.model.components.detectors.NCDefaultStopWordsDetector;
-import org.apache.nlpcraft.model.components.detectors.NCSimpleWordsDetector;
+import
org.apache.nlpcraft.model.components.detectors.NCConfiguredWordsDetector;
import org.apache.nlpcraft.model.components.ner.synonyms.NCSynonymsNerValue;
import org.apache.nlpcraft.model.builders.NCModelBuilder;
import org.apache.nlpcraft.model.components.ner.synonyms.NCSynonymsNerElement;
@@ -36,21 +35,15 @@ import
org.apache.nlpcraft.model.components.ner.synonyms.builders.NCSynonymsNerE
import
org.apache.nlpcraft.model.components.ner.synonyms.builders.NCSynonymsNerParserBuilder;
import org.apache.nlpcraft.model.components.ner.opennlp.NCOpenNlpNerParser;
import org.apache.nlpcraft.model.components.tokenizer.NCOpenNlpTokenizer;
-import org.apache.nlpcraft.model.nlp.NCNlpWordsDetector;
-import org.apache.nlpcraft.model.nlp.NCNlpWord;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
import org.apache.nlpcraft.model.NCIntentRef;
@@ -98,7 +91,7 @@ public class NCSpec {
// Common.
withId("modleId").
withName("name").
- withSuspiciousWordsDetector(new
NCSimpleWordsDetector(Collections.singleton("bad"))).
+ withSuspiciousWordsDetector(new
NCConfiguredWordsDetector(Collections.singleton("bad"))).
withStopWordsDetector(
new NCDefaultStopWordsDetector(
new HashSet<>() {{ add("stop1"); add("stop2"); }}