This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/master by this push:
new 7a080d24 Fix for NLPCRAFT-516
7a080d24 is described below
commit 7a080d2430af0094c58bf17f38f37fc0ad31a966
Author: Aaron Radzinski <[email protected]>
AuthorDate: Mon Oct 17 13:12:04 2022 -0700
Fix for NLPCRAFT-516
---
.../test/scala/org/apache/nlpcraft/models/NCIntCalcModelSpec.scala | 4 ++--
.../apache/nlpcraft/internal/intent/compiler/NCIDLCodeGenerator.scala | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git
a/nlpcraft-stanford/src/test/scala/org/apache/nlpcraft/models/NCIntCalcModelSpec.scala
b/nlpcraft-stanford/src/test/scala/org/apache/nlpcraft/models/NCIntCalcModelSpec.scala
index a7a9a250..ab9ac1bb 100644
---
a/nlpcraft-stanford/src/test/scala/org/apache/nlpcraft/models/NCIntCalcModelSpec.scala
+++
b/nlpcraft-stanford/src/test/scala/org/apache/nlpcraft/models/NCIntCalcModelSpec.scala
@@ -54,7 +54,7 @@ object NCIntCalcModelSpec:
@NCIntent(
"intent=calc options={ 'ordered': true }" +
" term(x)={# == 'stanford:number'} " +
- " term(op)={# == 'nlp:token' && has(list('+', '-', '*', '/'),
meta_ent('nlp:token:text')) == true} " +
+ " term(op)={has(list('+', '-', '*', '/'),
meta_ent('nlp:token:text')) == true} " +
" term(y)={# == 'stanford:number'}"
)
def onMatch(
@@ -67,7 +67,7 @@ object NCIntCalcModelSpec:
@NCIntent(
"intent=calcMem options={ 'ordered': true }" +
- " term(op)={# == 'nlp:token' && has(list('+', '-', '*', '/'),
meta_ent('nlp:token:text')) == true} " +
+ " term(op)={has(list('+', '-', '*', '/'),
meta_ent('nlp:token:text')) == true} " +
" term(y)={# == 'stanford:number'}"
)
def onMatchMem(
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCodeGenerator.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCodeGenerator.scala
index 94aa7038..eab9d4b7 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCodeGenerator.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCodeGenerator.scala
@@ -878,7 +878,7 @@ trait NCIDLCodeGenerator:
try
fun match
// Metadata access.
- case "meta_ent" => z[ST](arg1, { x => val Z(v, _) = x();
Z(box(ent.impl.get[Object](toStr(v)).orNull), 0) })
+ case "meta_ent" => z[ST](arg1, { x => val Z(v, _) = x();
Z(box(ent.impl.get[Object](toStr(v)).orNull), 1) })
case "meta_cfg" => z[ST](arg1, { x => val Z(v, _) = x();
Z(box(idlCtx.mdlCfg.get[Object](toStr(v)).orNull), 0) })
case "meta_req" => z[ST](arg1, { x => val Z(v, _) = x();
Z(box(idlCtx.req.getRequestData.get(toStr(v)).orNull.asInstanceOf[Object]), 0)
})
case "meta_intent" => z[ST](arg1, { x => val Z(v, _) = x();
Z(box(idlCtx.intentMeta.get(toStr(v)).orNull), 0) })