This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-278
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-278 by this push:
new d08e9db Update NCIdlCompilerBase.scala
d08e9db is described below
commit d08e9db0da1e861c5f509a6b409aeb46dc897933
Author: Aaron Radzinski <[email protected]>
AuthorDate: Tue Mar 23 14:31:05 2021 -0700
Update NCIdlCompilerBase.scala
---
.../nlpcraft/model/intent/compiler/NCIdlCompilerBase.scala | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompilerBase.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompilerBase.scala
index 605f720..b0b83d7 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompilerBase.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompilerBase.scala
@@ -619,8 +619,8 @@ trait NCIdlCompilerBase {
try
if (lst.isEmpty)
- Z(0, n)
- else
+ throw newRuntimeError(s"Unexpected empty list in IDL
function '$fun()'.")
+ else
Z(Collections.min(lst, null), n)
catch {
case e: Exception ⇒ throw rtListTypeError(fun, e)
@@ -638,7 +638,7 @@ trait NCIdlCompilerBase {
try
if (lst.isEmpty)
- Z(0, n)
+ throw newRuntimeError(s"Unexpected empty list in IDL
function '$fun()'.")
else
Z(Collections.max(lst, null), n)
catch {
@@ -949,8 +949,8 @@ trait NCIdlCompilerBase {
case "to_string" ⇒ z[ST](arg1, { x ⇒ val Z(v, n) = x();
Z(toJList(v).asScala.map(_.toString).asJava, n) })
// Statistical operations on lists.
- case "max" ⇒ doMin()
- case "min" ⇒ doMax()
+ case "max" ⇒ doMax()
+ case "min" ⇒ doMin()
// Date-time functions.
case "year" ⇒ z0(() ⇒ Z(LocalDate.now.getYear, 0)) // 2021.