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 6e7c447 WIP.
6e7c447 is described below
commit 6e7c447cd4adcb2b42ec01fe07b6d7ae3fd26de9
Author: Aaron Radzinzski <[email protected]>
AuthorDate: Wed Mar 10 23:42:23 2021 -0800
WIP.
---
.../nlpcraft/model/intent/compiler/NCDslBaselCompiler.scala | 11 ++++++-----
.../nlpcraft/model/intent/solver/NCIntentSolverEngine.scala | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslBaselCompiler.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslBaselCompiler.scala
index d50eb7e..4f59ce1 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslBaselCompiler.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslBaselCompiler.scala
@@ -26,7 +26,8 @@ import org.apache.nlpcraft.model.intent.NCDslContext
import java.lang.{Double ⇒ JDouble, Long ⇒ JLong}
import java.time.LocalDate
-import java.util.{Collections, ArrayList ⇒ JList, HashMap ⇒ JMap}
+import java.util
+import java.util.{Collections, List ⇒ JList, Map ⇒ JMap}
import scala.collection.JavaConverters._
import scala.collection.mutable
@@ -446,7 +447,7 @@ trait NCDslBaselCompiler {
* Collection, statistical operations.
*/
def doList(): Unit = {
- val jl = new JList[Object]() // Empty list is allowed.
+ val jl = new util.ArrayList[Object]() // Empty list is allowed.
var f = false
stack.drain { x ⇒
@@ -476,7 +477,7 @@ trait NCDslBaselCompiler {
if (stack.size % 2 != 0)
throw rtParamNumError(fun)
- val jm = new JMap[Object, Object]()
+ val jm = new util.HashMap[Object, Object]()
var f = false
val keys = mutable.Buffer.empty[Object]
@@ -675,8 +676,8 @@ trait NCDslBaselCompiler {
case "remove" ⇒
case "first" ⇒
case "last" ⇒
- case "keys" ⇒ get1Map() match { case (map, f) ⇒ pushAny(new
JList(map.keySet()), f) }
- case "values" ⇒ get1Map() match { case (map, f) ⇒ pushAny(new
JList(map.values()), f) }
+ case "keys" ⇒ get1Map() match { case (map, f) ⇒ pushAny(new
util.ArrayList(map.keySet()), f) }
+ case "values" ⇒ get1Map() match { case (map, f) ⇒ pushAny(new
util.ArrayList(map.values()), f) }
case "take" ⇒
case "drop" ⇒
case "size" ⇒ doSize()
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 692a452..18f986b 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
@@ -690,7 +690,7 @@ object NCIntentSolverEngine extends LazyLogging with
NCOpenCensusTrace {
}
// We've found some matches (and min > 0).
else {
- require(matches > 0 && matches > min)
+ require(matches >= min)
val convSrvReqIds =
convToks.map(_.token.getServerRequestId).distinct