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 9496e65 WIP.
9496e65 is described below
commit 9496e653cd21f400283cd199b63af1b653f21d39
Author: Sergey Kamov <[email protected]>
AuthorDate: Thu Oct 7 22:04:38 2021 +0300
WIP.
---
.../nlpcraft/model/builders/NCIntentsBuilder.java | 2 +-
.../nlpcraft/model/builders/NCModelConfigBuilder.java | 4 ++--
.../src/test/java/org/apache/nlpcraft/model/NCSpec.java | 17 +++++++++++++----
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCIntentsBuilder.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCIntentsBuilder.java
index a14623e..e302a76 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCIntentsBuilder.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCIntentsBuilder.java
@@ -16,7 +16,7 @@ public class NCIntentsBuilder {
return null;
}
- public List<String> getIntentsDls() {
+ public Map<String, String> getIntents() {
// TODO: implement.
return null;
}
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelConfigBuilder.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelConfigBuilder.java
index d150c39..371933f 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelConfigBuilder.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/builders/NCModelConfigBuilder.java
@@ -116,11 +116,11 @@ public class NCModelConfigBuilder {
return null;
}
- public NCModelConfigBuilder withIntentsDsl(List<String> intentsDsl) {
+ public NCModelConfigBuilder withIntents(Map<String, String> intentsDsl) {
return null;
}
- public NCModelConfigBuilder withIntentsDslSamples(Map<String,
List<List<String>>> samples) {
+ public NCModelConfigBuilder withIntentsSamples(Map<String,
List<List<String>>> samples) {
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 209f905..22e3ad9 100644
--- a/nlpcraft/src/test/java/org/apache/nlpcraft/model/NCSpec.java
+++ b/nlpcraft/src/test/java/org/apache/nlpcraft/model/NCSpec.java
@@ -25,6 +25,15 @@ public class NCSpec {
return Collections.singletonList(s);
}
+ private static <T, R> Map<T, R> asMap(T k, R v) {
+ Map<T, R> m = new HashMap<>();
+
+ m.put(k, v);
+
+ return m;
+ }
+
+
private NCModelConfig getModelConfig() {
Map<String, NCValueLoader> loaders = new HashMap<>();
@@ -58,12 +67,12 @@ public class NCSpec {
new NCModelConfigBuilder().
withDescription("test model").
withElements(elements).
- withIntentsDsl(
+ withIntents(
new NCIntentsBuilder().
withClasses(SomeClassWithIntents.class).
- getIntentsDls()
+ getIntents()
).
- withIntentsDslSamples(
+ withIntentsSamples(
new NCIntentsSamplesBuilder().
withClasses(SomeClassWithIntents.class).
getSamples()
@@ -111,7 +120,7 @@ public class NCSpec {
getElement()
)
).
- withIntentsDsl(asList("intent=req term(date)~{# ==
'opennlp:date'}?")).
+ withIntents(asMap("req", "intent=req term(date)~{# ==
'opennlp:date'}?")).
getModelConfig()
).getModel();