This is an automated email from the ASF dual-hosted git repository. sergeykamov pushed a commit to branch NLPCRAFT-376-TEST-FIX in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
commit dcdb5687c96a78558fde84ff4b68efede1fbd747 Author: Sergey Kamov <[email protected]> AuthorDate: Sat Jul 24 01:50:47 2021 +0300 SQL model fixes. --- .../sql/src/main/java/org/apache/nlpcraft/examples/sql/SqlModel.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nlpcraft-examples/sql/src/main/java/org/apache/nlpcraft/examples/sql/SqlModel.scala b/nlpcraft-examples/sql/src/main/java/org/apache/nlpcraft/examples/sql/SqlModel.scala index 181ae8b..2163a75 100644 --- a/nlpcraft-examples/sql/src/main/java/org/apache/nlpcraft/examples/sql/SqlModel.scala +++ b/nlpcraft-examples/sql/src/main/java/org/apache/nlpcraft/examples/sql/SqlModel.scala @@ -400,7 +400,6 @@ class SqlModel extends NCModelFileAdapter("sql_model.yaml") with LazyLogging { * cleared between user questions, except for the obvious clarifying questions. We assume that question is being * clarified if its tokens satisfy one of criteria: * - all these tokens are values (What about 'Exotic Liquids') - * - all these tokens are columns (Give me 'last name') * - new token is single date token (What about 'tomorrow') * <p> * If new sentence tokens satisfied any of these criteria, @@ -418,10 +417,9 @@ class SqlModel extends NCModelFileAdapter("sql_model.yaml") with LazyLogging { case Some(col) => col.getValue != null case None => false } - def isColumn(t: NCToken): Boolean = findAnyColumnTokenOpt(t).isDefined def isDate(t: NCToken): Boolean = t.getId == "nlpcraft:date" - val ok = toks.forall(isValue) || toks.forall(isColumn) || toks.size == 1 && isDate(toks.head) + val ok = toks.forall(isValue) || toks.size == 1 && isDate(toks.head) if (!ok) { m.getContext.getConversation.clearStm(_ => true)
