This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-376
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-376 by this push:
new 2c4b31b WIP.
2c4b31b is described below
commit 2c4b31b230416652f8d4753964cd4ccc1f1875e0
Author: Sergey Kamov <[email protected]>
AuthorDate: Wed Jul 28 13:54:19 2021 +0300
WIP.
---
.../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)