This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-490
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-490 by this push:
new 8f5eed5 WIP.
8f5eed5 is described below
commit 8f5eed5db18f11b5967a556294d6c676ef601826
Author: Sergey Kamov <[email protected]>
AuthorDate: Tue Mar 29 23:11:11 2022 +0300
WIP.
---
.../apache/nlpcraft/internal/intent/matcher/NCIntentSolverManager.scala | 2 +-
.../org/apache/nlpcraft/internal/conversation/NCConversationSpec.scala | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/matcher/NCIntentSolverManager.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/matcher/NCIntentSolverManager.scala
index 74a751a..3ebde23 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/matcher/NCIntentSolverManager.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/matcher/NCIntentSolverManager.scala
@@ -255,7 +255,7 @@ class NCIntentSolverManager(
for (
(vrn, vrnIdx) <- ctx.getVariants.asScala.zipWithIndex if
mdl.onVariant(vrn);
ents = vrn.getEntities.asScala;
- varEntsGroups = ents.map(t => if t.getGroups != null then
t.getGroups.asScala else Set.empty[String]);
+ varEntsGroups = ents.filter(t => t.getGroups != null &&
!t.getGroups.isEmpty).map(_.getGroups.asScala);
(intent, callback) <- intents
)
val convEnts: Seq[IntentEntity] =
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationSpec.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationSpec.scala
index 7b23d5c..f218168 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationSpec.scala
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationSpec.scala
@@ -37,7 +37,7 @@ class NCConversationSpec:
override def getPipeline: NCPipeline = new
NCPipelineBuilder().withSemantic("en", Seq(TE("e1"), TE("e2")).asJava).build()
override def getConfig: NCModelConfig = CFG
- @NCIntent("intent=i1 term(t1)={# == 'e1'} term(t2)={# == 'e2'}?")
+ @NCIntent("intent=i1 term(t1)~{# == 'e1'} term(t2)~{# == 'e2'}?")
def onMatch(@NCIntentTerm("t1") t1: NCEntity, @NCIntentTerm("t2")
t2: Option[NCEntity]): NCResult = new NCResult()
Using.resource(new NCModelClient(mdl)) { cli =>