This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch master-model
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/master-model by this push:
new d11c277 WIP.
d11c277 is described below
commit d11c2771c07b5d1b21670c1d64adee68a5666e02
Author: Sergey Kamov <[email protected]>
AuthorDate: Thu Oct 7 19:57:22 2021 +0300
WIP.
---
.../org/apache/nlpcraft/model/NCIntentSkip.java | 4 +-
.../scala/org/apache/nlpcraft/model/NCModel.java | 2 +-
.../{NCModelBehaviour.java => NCModelAction.java} | 2 +-
.../nlpcraft/model/annotations/NCIntent.java | 2 -
.../annotations/{delete => }/NCIntentRef.java | 7 ++-
.../nlpcraft/model/annotations/NCIntentSample.java | 2 -
.../{delete => }/NCIntentSampleRef.java | 8 ++--
.../nlpcraft/model/annotations/NCIntentTerm.java | 4 --
.../annotations/delete/NCAddElementClass.java | 2 +-
.../annotations/delete/NCModelAddClasses.java | 2 +
.../annotations/delete/NCModelAddPackage.java | 2 +
.../model/builders/NCModelActionBuilder.java | 54 +++++++++++++++++++++
.../model/builders/NCModelBehaviourBuilder.java | 55 ----------------------
.../nlpcraft/model/builders/NCModelBuilder.java | 10 +---
.../nlpcraft/model/impl/NCElementsProvider.java | 9 ++++
.../nlpcraft/model/impl/NCIntentsProvider.java | 24 ++++++++--
.../java/org/apache/nlpcraft/model/NCSpec.java | 20 ++++----
17 files changed, 111 insertions(+), 98 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSkip.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSkip.java
index 8e466cf..e97f653 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSkip.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSkip.java
@@ -21,8 +21,8 @@ import org.apache.nlpcraft.common.*;
import org.apache.nlpcraft.model.annotations.NCIntent;
import org.apache.nlpcraft.model.annotations.NCIntentSample;
import org.apache.nlpcraft.model.annotations.NCIntentTerm;
-import org.apache.nlpcraft.model.annotations.delete.NCIntentRef;
-import org.apache.nlpcraft.model.annotations.delete.NCIntentSampleRef;
+import org.apache.nlpcraft.model.annotations.NCIntentRef;
+import org.apache.nlpcraft.model.annotations.NCIntentSampleRef;
/**
* Control flow exception to skip current intent. This exception can be thrown
by the intent
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModel.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModel.java
index 62bb62a..25dc95b 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModel.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModel.java
@@ -24,7 +24,7 @@ import java.util.List;
public interface NCModel {
// 2 different configs.
NCModelConfig getModelConfig();
- NCModelBehaviour getModelBehaviour();
+ NCModelAction getModelAction();
// Lifecycle. TODO: I am not sure that we need them. Look at it after
Server API development.
void start();
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModelBehaviour.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModelAction.java
similarity index 97%
rename from
nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModelBehaviour.java
rename to nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModelAction.java
index 7e4a01b..ac589b5 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModelBehaviour.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModelAction.java
@@ -24,7 +24,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-public interface NCModelBehaviour {
+public interface NCModelAction {
default List<String> getIntentsDsl() {
return null;
}
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntent.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntent.java
index 135d95a..bad4828 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntent.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntent.java
@@ -20,8 +20,6 @@ package org.apache.nlpcraft.model.annotations;
import org.apache.nlpcraft.model.NCIntentMatch;
import org.apache.nlpcraft.model.NCIntentSkip;
import org.apache.nlpcraft.model.NCModel;
-import org.apache.nlpcraft.model.annotations.delete.NCIntentRef;
-import org.apache.nlpcraft.model.annotations.delete.NCIntentSampleRef;
import org.apache.nlpcraft.model.annotations.delete.NCModelAddClasses;
import org.apache.nlpcraft.model.annotations.delete.NCModelAddPackage;
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCIntentRef.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentRef.java
similarity index 93%
rename from
nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCIntentRef.java
rename to
nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentRef.java
index 522cef6..5bf7d64 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCIntentRef.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentRef.java
@@ -15,14 +15,13 @@
* limitations under the License.
*/
-package org.apache.nlpcraft.model.annotations.delete;
+package org.apache.nlpcraft.model.annotations;
-import org.apache.nlpcraft.model.annotations.NCIntent;
import org.apache.nlpcraft.model.NCIntentMatch;
import org.apache.nlpcraft.model.NCIntentSkip;
-import org.apache.nlpcraft.model.annotations.NCIntentTerm;
import org.apache.nlpcraft.model.NCModel;
-import org.apache.nlpcraft.model.annotations.NCIntentSample;
+import org.apache.nlpcraft.model.annotations.delete.NCModelAddClasses;
+import org.apache.nlpcraft.model.annotations.delete.NCModelAddPackage;
import java.lang.annotation.*;
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentSample.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentSample.java
index 1720949..413a0a0 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentSample.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentSample.java
@@ -18,8 +18,6 @@
package org.apache.nlpcraft.model.annotations;
import org.apache.nlpcraft.model.NCIntentMatch;
-import org.apache.nlpcraft.model.annotations.delete.NCIntentRef;
-import org.apache.nlpcraft.model.annotations.delete.NCIntentSampleRef;
import org.apache.nlpcraft.model.NCIntentSkip;
import org.apache.nlpcraft.model.NCModel;
import org.apache.nlpcraft.model.annotations.delete.NCModelAddClasses;
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCIntentSampleRef.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentSampleRef.java
similarity index 93%
rename from
nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCIntentSampleRef.java
rename to
nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentSampleRef.java
index e13dd48..bfa8068 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCIntentSampleRef.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentSampleRef.java
@@ -15,14 +15,13 @@
* limitations under the License.
*/
-package org.apache.nlpcraft.model.annotations.delete;
+package org.apache.nlpcraft.model.annotations;
-import org.apache.nlpcraft.model.annotations.NCIntent;
import org.apache.nlpcraft.model.NCIntentMatch;
import org.apache.nlpcraft.model.NCIntentSkip;
-import org.apache.nlpcraft.model.annotations.NCIntentTerm;
import org.apache.nlpcraft.model.NCModel;
-import org.apache.nlpcraft.model.annotations.NCIntentSample;
+import org.apache.nlpcraft.model.annotations.delete.NCModelAddClasses;
+import org.apache.nlpcraft.model.annotations.delete.NCModelAddPackage;
import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
@@ -71,7 +70,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Target(value=METHOD)
@Repeatable(NCIntentSampleRef.NCIntentSampleList.class)
public @interface NCIntentSampleRef {
- // TODO: can be deleted,
/**
* Local file path, classpath resource path or URL supported by {@link
java.net.URL} class. The content of the source
* should be a new-line separated list of string. Empty strings and
strings starting with '#" (hash) symbol will
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentTerm.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentTerm.java
index 247f91c..c2c457f 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentTerm.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/NCIntentTerm.java
@@ -20,10 +20,6 @@ package org.apache.nlpcraft.model.annotations;
import org.apache.nlpcraft.model.NCIntentMatch;
import org.apache.nlpcraft.model.NCIntentSkip;
import org.apache.nlpcraft.model.NCModel;
-import org.apache.nlpcraft.model.annotations.NCIntent;
-import org.apache.nlpcraft.model.annotations.NCIntentSample;
-import org.apache.nlpcraft.model.annotations.delete.NCIntentRef;
-import org.apache.nlpcraft.model.annotations.delete.NCIntentSampleRef;
import org.apache.nlpcraft.model.annotations.delete.NCModelAddClasses;
import org.apache.nlpcraft.model.annotations.delete.NCModelAddPackage;
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCAddElementClass.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCAddElementClass.java
index 5243152..1daf4cd 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCAddElementClass.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCAddElementClass.java
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
-// TODO: class name
+// TODO: drop it,
@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCModelAddClasses.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCModelAddClasses.java
index 20d853f..6abfc7d 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCModelAddClasses.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCModelAddClasses.java
@@ -19,6 +19,8 @@ package org.apache.nlpcraft.model.annotations.delete;
import org.apache.nlpcraft.model.NCIntentMatch;
import org.apache.nlpcraft.model.NCIntentSkip;
+import org.apache.nlpcraft.model.annotations.NCIntentRef;
+import org.apache.nlpcraft.model.annotations.NCIntentSampleRef;
import org.apache.nlpcraft.model.annotations.NCIntentTerm;
import org.apache.nlpcraft.model.annotations.NCIntentSample;
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCModelAddPackage.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCModelAddPackage.java
index 97ca59d..c9a6c24 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCModelAddPackage.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/annotations/delete/NCModelAddPackage.java
@@ -19,6 +19,8 @@ package org.apache.nlpcraft.model.annotations.delete;
import org.apache.nlpcraft.model.NCIntentMatch;
import org.apache.nlpcraft.model.NCIntentSkip;
+import org.apache.nlpcraft.model.annotations.NCIntentRef;
+import org.apache.nlpcraft.model.annotations.NCIntentSampleRef;
import org.apache.nlpcraft.model.annotations.NCIntentTerm;
import org.apache.nlpcraft.model.annotations.NCIntentSample;
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelActionBuilder.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelActionBuilder.java
new file mode 100644
index 0000000..ce167e7
--- /dev/null
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelActionBuilder.java
@@ -0,0 +1,54 @@
+package org.apache.nlpcraft.model.builders;
+
+import org.apache.nlpcraft.model.NCContext;
+import org.apache.nlpcraft.model.NCIntentMatch;
+import org.apache.nlpcraft.model.NCRejection;
+import org.apache.nlpcraft.model.NCResult;
+import org.apache.nlpcraft.model.NCVariant;
+import org.apache.nlpcraft.model.NCModelAction;
+
+import java.util.List;
+import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.function.Predicate;
+
+public class NCModelActionBuilder {
+ public NCModelActionBuilder withIntentsDsl(List<String> intentsDsl) {
+ return null;
+ }
+
+ // IntentID - sample.
+ public NCModelActionBuilder withIntentsDslSamples(Map<String,
List<List<String>>> samples) {
+ return null;
+ }
+
+ public NCModelActionBuilder withOnParsedVariant(Predicate<NCVariant>
predicate) {
+ return null;
+ }
+
+ public NCModelActionBuilder withOnMatchedIntent(Predicate<NCIntentMatch>
predicate) throws NCRejection {
+ return null;
+ }
+
+ public NCModelActionBuilder withOnContext(Function<NCContext, NCResult>
resultMaker) throws NCRejection {
+ return null;
+ }
+
+
+ public NCModelActionBuilder withOnResult(BiFunction<NCIntentMatch,
NCResult, NCResult> resultMaker) {
+ return null;
+ }
+
+ public NCModelActionBuilder withOnRejection(BiFunction<NCIntentMatch,
NCRejection, NCResult> resultMaker) {
+ return null;
+ }
+
+ public NCModelActionBuilder withOnError(BiFunction<NCContext, Throwable,
NCResult> resultMaker) {
+ return null;
+ }
+
+ public NCModelAction make() {
+ return null;
+ }
+}
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelBehaviourBuilder.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelBehaviourBuilder.java
deleted file mode 100644
index 74655c7..0000000
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelBehaviourBuilder.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.nlpcraft.model.builders;
-
-import org.apache.nlpcraft.model.NCContext;
-import org.apache.nlpcraft.model.NCIntentMatch;
-import org.apache.nlpcraft.model.NCRejection;
-import org.apache.nlpcraft.model.NCResult;
-import org.apache.nlpcraft.model.NCVariant;
-import org.apache.nlpcraft.model.NCModelBehaviour;
-
-import java.util.List;
-import java.util.Map;
-import java.util.function.BiFunction;
-import java.util.function.Function;
-import java.util.function.Predicate;
-import java.util.function.Supplier;
-
-public class NCModelBehaviourBuilder {
- public NCModelBehaviourBuilder withIntentsDsl(List<String> intentsDsl) {
- return null;
- }
-
- // IntentID - sample.
- public NCModelBehaviourBuilder withIntentsDslSamples(Map<String,
List<List<String>>> samples) {
- return null;
- }
-
- public NCModelBehaviourBuilder withOnParsedVariant(Predicate<NCVariant>
predicate) {
- return null;
- }
-
- public NCModelBehaviourBuilder
withOnMatchedIntent(Predicate<NCIntentMatch> predicate) throws NCRejection {
- return null;
- }
-
- public NCModelBehaviourBuilder withOnContext(Function<NCContext, NCResult>
resultMaker) throws NCRejection {
- return null;
- }
-
-
- public NCModelBehaviourBuilder withOnResult(BiFunction<NCIntentMatch,
NCResult, NCResult> resultMaker) {
- return null;
- }
-
- public NCModelBehaviourBuilder withOnRejection(BiFunction<NCIntentMatch,
NCRejection, NCResult> resultMaker) {
- return null;
- }
-
- public NCModelBehaviourBuilder withOnError(BiFunction<NCContext,
Throwable, NCResult> resultMaker) {
- return null;
- }
-
- public NCModelBehaviour make() {
- return null;
- }
-}
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelBuilder.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelBuilder.java
index c0c8058..2d7b08e 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelBuilder.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelBuilder.java
@@ -1,20 +1,14 @@
package org.apache.nlpcraft.model.builders;
-import org.apache.nlpcraft.model.NCElement;
import org.apache.nlpcraft.model.NCModel;
-import org.apache.nlpcraft.model.NCModelBehaviour;
+import org.apache.nlpcraft.model.NCModelAction;
import org.apache.nlpcraft.model.NCModelConfig;
-import org.apache.nlpcraft.model.NCValue;
-import org.apache.nlpcraft.model.NCValueLoader;
-
-import java.util.List;
-import java.util.Map;
public class NCModelBuilder {
public NCModelBuilder withConfig(NCModelConfig cfg) {
return null;
}
- public NCModelBuilder withModelBehaviour(NCModelBehaviour b) {
+ public NCModelBuilder withModelAction(NCModelAction a) {
return null;
}
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/impl/NCElementsProvider.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/impl/NCElementsProvider.java
index 031ac9c..242ef65 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/impl/NCElementsProvider.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/impl/NCElementsProvider.java
@@ -13,6 +13,7 @@ public class NCElementsProvider {
private List<File> files;
private List<URL> urls;
private List<Class<?>> classes;
+ private List<NCElement> elements;
public Map<String, NCValueLoader> getLoaders() {
return loaders;
@@ -47,6 +48,14 @@ public class NCElementsProvider {
}
public List<NCElement> getElements() {
+ return elements;
+ }
+
+ public void setElements(List<NCElement> elements) {
+ this.elements = elements;
+ }
+
+ public List<NCElement> getDetectedElements() {
// TODO: implement.
return null;
}
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/impl/NCIntentsProvider.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/impl/NCIntentsProvider.java
index f08d648..5c06f7d 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/impl/NCIntentsProvider.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/impl/NCIntentsProvider.java
@@ -8,9 +8,12 @@ import java.util.Map;
public class NCIntentsProvider {
private List<File> intentsFiles;
private List<URL> intentsUrls;
+ private List<String> intents;
// Intent ID - samples
private Map<String, File> samplesFiles;
private Map<String, URL> samplesUrls;
+ private Map<String, List<List<String>>> samples;
+
private List<Class<?>> classes;
public List<File> getIntentsFiles() {
@@ -53,14 +56,29 @@ public class NCIntentsProvider {
this.samplesUrls = samplesUrls;
}
- public List<String> getIntentsDls() {
+ public List<String> getIntents() {
+ return intents;
+ }
+
+ public void setIntents(List<String> intents) {
+ this.intents = intents;
+ }
+
+ public Map<String, List<List<String>>> getSamples() {
+ return samples;
+ }
+
+ public void setSamples(Map<String, List<List<String>>> samples) {
+ this.samples = samples;
+ }
+
+ public List<String> getDetectedIntentsDls() {
// TODO: implement.
return null;
}
- public Map<String, List<List<String>>> getIntentsSamples() {
+ public Map<String, List<List<String>>> getDetectedIntentsSamples() {
// TODO: implement.
return null;
}
-
}
diff --git a/nlpcraft/src/test/java/org/apache/nlpcraft/model/NCSpec.java
b/nlpcraft/src/test/java/org/apache/nlpcraft/model/NCSpec.java
index 093890c..0d572c3 100644
--- a/nlpcraft/src/test/java/org/apache/nlpcraft/model/NCSpec.java
+++ b/nlpcraft/src/test/java/org/apache/nlpcraft/model/NCSpec.java
@@ -1,8 +1,8 @@
package org.apache.nlpcraft.model;
-import org.apache.nlpcraft.model.annotations.delete.NCIntentRef;
+import org.apache.nlpcraft.model.annotations.NCIntentRef;
import org.apache.nlpcraft.model.builders.NCElementBuilder;
-import org.apache.nlpcraft.model.builders.NCModelBehaviourBuilder;
+import org.apache.nlpcraft.model.builders.NCModelActionBuilder;
import org.apache.nlpcraft.model.builders.NCModelConfigBuilder;
import org.apache.nlpcraft.model.builders.NCModelBuilder;
import org.apache.nlpcraft.model.impl.NCElementsProvider;
@@ -42,7 +42,7 @@ public class NCSpec {
elemsProvider.setFiles(asList(new java.io.File("path.yaml")));
elemsProvider.setLoaders(loaders);
- List<NCElement> elements = elemsProvider.getElements();
+ List<NCElement> elements = elemsProvider.getDetectedElements();
elements.add(new
NCElementBuilder().withId("additionalElementId").make());
@@ -53,7 +53,7 @@ public class NCSpec {
make();
}
- private NCModelBehaviour getModelBehaviour() {
+ private NCModelAction getModelAction() {
NCIntentsProvider intentsProvider = new NCIntentsProvider();
class SomeClassWithIntents {
@@ -65,12 +65,12 @@ public class NCSpec {
intentsProvider.setClasses(asList(SomeClassWithIntents.class));
- List<String> intents = intentsProvider.getIntentsDls();
+ List<String> intents = intentsProvider.getDetectedIntentsDls();
return
- new NCModelBehaviourBuilder().
- withIntentsDsl(intentsProvider.getIntentsDls()).
- withIntentsDslSamples(intentsProvider.getIntentsSamples()).
+ new NCModelActionBuilder().
+ withIntentsDsl(intentsProvider.getDetectedIntentsDls()).
+
withIntentsDslSamples(intentsProvider.getDetectedIntentsSamples()).
withOnRejection(new BiFunction<NCIntentMatch, NCRejection,
NCResult>() {
@Override
public NCResult apply(NCIntentMatch math, NCRejection rej)
{
@@ -84,7 +84,7 @@ public class NCSpec {
return
new NCModelBuilder().
withConfig(getModelConfig()).
- withModelBehaviour(getModelBehaviour()).
+ withModelAction(getModelAction()).
make();
}
@@ -106,7 +106,7 @@ public class NCSpec {
NCModel mdl =
new NCModelBuilder().
withConfig(new NCModelConfigBuilder().withElements(asList(new
NCElementBuilder().withId("elemeId").withSynonyms(asList("element")).make())).make()).
- withModelBehaviour(new
NCModelBehaviourBuilder().withIntentsDsl(asList("intent=req term(date)~{# ==
'opennlp:date'}?")).make()).
+ withModelAction(new
NCModelActionBuilder().withIntentsDsl(asList("intent=req term(date)~{# ==
'opennlp:date'}?")).make()).
make();
mdl.start();