This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-206
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-206 by this push:
new 06e1054 WIP.
06e1054 is described below
commit 06e1054fb24fdc046a224cd76da0f3f460fcc63b
Author: Aaron Radzinzski <[email protected]>
AuthorDate: Wed Mar 10 23:32:49 2021 -0800
WIP.
---
.../org/apache/nlpcraft/model/intent/compiler/NCDslCompiler.scala | 2 +-
.../apache/nlpcraft/model/intent/solver/NCIntentSolverEngine.scala | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslCompiler.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslCompiler.scala
index 76df6fe..b3247b7 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslCompiler.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslCompiler.scala
@@ -213,7 +213,7 @@ object NCDslCompiler extends LazyLogging {
if (max < 1)
throw newSyntaxError(s"Invalid intent term max quantifiers:
$max (must be max >= 1).")(ctx.minMax())
- val pred: NCDslTokenPredicate = if (refMtdName != null) { //
User-code defined term.
+ val pred: NCDslTokenPredicate = if (refMtdName.isDefined) { //
User-code defined term.
// Closure copies.
val clsName = refClsName.orNull
val mtdName = refMtdName.orNull
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolverEngine.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolverEngine.scala
index d32f11b..692a452 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolverEngine.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolverEngine.scala
@@ -484,10 +484,12 @@ object NCIntentSolverEngine extends LazyLogging with
NCOpenCensusTrace {
var abort = false
val ordered = intent.ordered
var lastTermMatch: TermMatch = null
+
+ val x = ctx.getConversation.getMetadata
val termCtx = NCDslContext(
intentMeta = intent.meta,
- convMeta =
ctx.getConversation.getMetadata.asScala.toMap[String, Object],
+ convMeta = if (x.isEmpty) Map.empty[String, Object] else
x.asScala.toMap[String, Object],
req = ctx.getRequest
)