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 9aaa2ef WIP.
9aaa2ef is described below
commit 9aaa2ef4bdc874834146d2b2478c40470b53110c
Author: Aaron Radzinski <[email protected]>
AuthorDate: Fri Mar 12 20:46:52 2021 -0800
WIP.
---
.../org/apache/nlpcraft/examples/sql/sql_model.yaml | 16 ++++++++--------
.../apache/nlpcraft/common/makro/NCMacroParserSpec.scala | 2 +-
.../nlpcraft/model/abstract/NCAbstractTokensModel.scala | 2 +-
.../apache/nlpcraft/model/intent/dsl/dsl_test_model.yaml | 4 ++--
.../org/apache/nlpcraft/models/stm/NCStmTestModel.scala | 8 ++++----
.../nlp/enrichers/model/NCEnricherNestedModelSpec.scala | 4 ++--
.../nlp/enrichers/model/NCEnricherNestedModelSpec2.scala | 2 +-
.../apache/nlpcraft/server/rest/NCRestModelSpec.scala | 2 +-
8 files changed, 20 insertions(+), 20 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/sql_model.yaml
b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/sql_model.yaml
index 063b267..39929df 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/sql_model.yaml
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/sql_model.yaml
@@ -1450,38 +1450,38 @@ elements:
groups:
- "element"
synonyms:
- - "^^[colVal](has(groups(), 'column') && value() != null)^^"
+ - "^^[colVal]{has(groups(), 'column') && value() != null}^^"
- id: "col:num"
groups:
- "element"
synonyms:
- - "^^id() == 'col' && has(list(4, 8), meta_part(part('colName'),
'sql:datatype'))^^"
+ - "^^{id() == 'col' && has(list(4, 8), meta_part(part('colName'),
'sql:datatype')}^^"
- id: "col:date"
groups:
- "element"
synonyms:
- - "^^id() == 'col' && meta_part(part('colName'), 'sql:datatype') == 91^^"
+ - "^^{id() == 'col' && meta_part(part('colName'), 'sql:datatype') == 91}^^"
- id: "col:varchar"
groups:
- "element"
synonyms:
- - "^^id() == 'col' && meta_part(part('colName'), 'sql:datatype') == 12^^"
+ - "^^{id() == 'col' && meta_part(part('colName'), 'sql:datatype') == 12}^^"
- id: "condition:num"
groups:
- "condition"
synonyms:
- - "^^id() == 'col:num'^^ ^^id() == 'nlpcraft:num'^^ "
+ - "^^{id() == 'col:num'^^ ^^id() == 'nlpcraft:num'}^^ "
- id: "condition:value"
groups:
- "condition"
synonyms:
- - "^^id() == 'col:varchar'^^ {is|equal|_} ^^id() == 'col:val'^^"
- - "^^id() == 'col:val'^^"
+ - "^^{id() == 'col:varchar'^^ {is|equal|_} ^^id() == 'col:val'}^^"
+ - "^^{id() == 'col:val'}^^"
- id: "condition:date"
groups:
- "condition"
synonyms:
- - "^^id() == 'col:date'^^ ^^id() == 'nlpcraft:date'^^ "
+ - "^^{id() == 'col:date'^^ ^^id() == 'nlpcraft:date'}^^"
- id: "sort:best"
groups:
- "Sort criteria"
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/common/makro/NCMacroParserSpec.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/common/makro/NCMacroParserSpec.scala
index f2cf226..4f4533c 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/common/makro/NCMacroParserSpec.scala
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/common/makro/NCMacroParserSpec.scala
@@ -145,7 +145,7 @@ class NCMacroParserSpec {
checkEq("//[a-zA-Z0-9]+//", Seq("//[a-zA-Z0-9]+//"))
checkEq("the ^^[internal]{id() == 'anyWord'}^^", Seq("the
^^[internal]{id() == 'anyWord'}^^"))
checkEq("{A}[0,1] ^^[internal]{id() == 'anyWord'}^^",
Seq("^^[internal]{id() == 'anyWord'}^^", "A ^^[internal]{id() == 'anyWord'}^^"))
- checkEq("w1 ^^{id == 'nlpcraft:num'}^^ w2", Seq("w1 ^^{id ==
'nlpcraft:num'}^^ w2"))
+ checkEq("w1 ^^{id() == 'nlpcraft:num'}^^ w2", Seq("w1 ^^{id() ==
'nlpcraft:num'}^^ w2"))
checkEq("before limit ^^[limitAlias]{id() == 'nlpcraft:limit'}^^",
Seq("before limit ^^[limitAlias]{id() == 'nlpcraft:limit'}^^"))
checkEq("wrap ^^[wrapLimitAlias]{id() == 'wrapLimit'}^^", Seq("wrap
^^[wrapLimitAlias]{id() == 'wrapLimit'}^^"))
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/abstract/NCAbstractTokensModel.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/abstract/NCAbstractTokensModel.scala
index 0a919a6..1bcca79 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/abstract/NCAbstractTokensModel.scala
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/abstract/NCAbstractTokensModel.scala
@@ -30,7 +30,7 @@ class NCAbstractTokensModel extends NCModelAdapter(
Set(
NCTestElement("anyWord", "//[a-zA-Z0-9]+//"),
NCTestElement("wrapAnyWord", "the ^^[internal]{id() ==
'anyWord'}^^"),
- NCTestElement("wrapNum", "w1 ^^{id == 'nlpcraft:num'}^^ w2"),
+ NCTestElement("wrapNum", "w1 ^^{id() == 'nlpcraft:num'}^^ w2"),
NCTestElement("wrapLimit", "before limit ^^[limitAlias]{id() ==
'nlpcraft:limit'}^^"),
NCTestElement("wrapWrapLimit", "wrap ^^[wrapLimitAlias]{id() ==
'wrapLimit'}^^")
)
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/dsl_test_model.yaml
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/dsl_test_model.yaml
index 824f0f2..cad9859 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/dsl_test_model.yaml
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/dsl_test_model.yaml
@@ -38,7 +38,7 @@ elements:
floatVal: 1.5
textVal: "a2"
synonyms:
- - "{second|2nd} ^^[alias1](trim(id) == 'a')^^"
+ - "{second|2nd} ^^[alias1]{(}trim(id) == 'a'}^^"
- id: "a3"
metadata:
intVal: 2
@@ -49,7 +49,7 @@ elements:
- "{a33|a3}"
- id: "a4"
synonyms:
- - "{fourth|4th} ^^[alias4]{id == 'a3'}^^"
+ - "{fourth|4th} ^^[alias4]{id() == 'a3'}^^"
intents:
- "intent=i1 term(t1)={id() == 'a' && meta_token('txt') == 'x'}"
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/models/stm/NCStmTestModel.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/models/stm/NCStmTestModel.scala
index b00231a..c38bfb9 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/models/stm/NCStmTestModel.scala
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/models/stm/NCStmTestModel.scala
@@ -41,15 +41,15 @@ class NCStmTestModel extends
NCModelAdapter("nlpcraft.stm.test", "STM Test Model
override def getGroups: util.List[String] = groups.asJava
}
- @NCIntent("intent=sale term~{id=='sale'}")
+ @NCIntent("intent=sale term~{id() == 'sale'}")
private def onSale(ctx: NCIntentMatch): NCResult = NCResult.text("sale")
- @NCIntent("intent=buy term~{id=='buy'}")
+ @NCIntent("intent=buy term~{id() == 'buy'}")
private def onBuy(ctx: NCIntentMatch): NCResult = NCResult.text("buy")
- @NCIntent("intent=sale_best_employee term~{id=='sale'}
term~{id=='best_employee'}")
+ @NCIntent("intent=sale_best_employee term~{id() == 'sale'} term~{id() ==
'best_employee'}")
private def onBestEmployeeSale(ctx: NCIntentMatch): NCResult =
NCResult.text("sale_best_employee")
- @NCIntent("intent=buy_best_employee term~{id=='buy'}
term~{id=='best_employee'}")
+ @NCIntent("intent=buy_best_employee term~{id() =='buy'} term~{id()
=='best_employee'}")
private def onBestEmployeeBuy(ctx: NCIntentMatch): NCResult =
NCResult.text("buy_best_employee")
}
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec.scala
index 7fac5ca..c9066f6 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec.scala
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec.scala
@@ -34,8 +34,8 @@ class NCNestedTestModel extends NCDefaultTestModel {
NCTestElement("x2", "{test1|_} ^^{id() == 'x1'}^^"),
NCTestElement("x3", "{test2|_} ^^{id() == 'x2'}^^"),
NCTestElement("y1", "y"),
- NCTestElement("y2", "^^{id == 'y1'}^^"),
- NCTestElement("y3", "^^{id == 'y2'}^^ ^^{id == 'y2'}^^")
+ NCTestElement("y2", "^^{id() == 'y1'}^^"),
+ NCTestElement("y3", "^^{id() == 'y2'}^^ ^^{id() == 'y2'}^^")
)
}
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec2.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec2.scala
index bf9bc8c..11c1468 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec2.scala
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec2.scala
@@ -33,7 +33,7 @@ class NCNestedTestModel21 extends
NCModelAdapter("nlpcraft.nested2.test.mdl", "N
@NCIntent("intent=onE1 term(t1)={id() == 'e1'}")
def onAB(ctx: NCIntentMatch): NCResult = NCResult.text("OK")
- @NCIntent("intent=onNumAndE1 term(t1)={id() == 'nlpcraft:num'}
term(t1)={id() == 'e1'}")
+ @NCIntent("intent=onNumAndE1 term(t1)={id() == 'nlpcraft:num'}
term(t2)={id() == 'e1'}")
def onNumAndE1(ctx: NCIntentMatch): NCResult = NCResult.text("OK")
override def isPermutateSynonyms: Boolean = false
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestModelSpec.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestModelSpec.scala
index 2327b0d..09d9a37 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestModelSpec.scala
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestModelSpec.scala
@@ -30,7 +30,7 @@ import scala.collection.JavaConverters._
@NCTestEnvironment(model = classOf[AlarmModel], startClient = false)
class NCRestModelSpec extends NCRestSpec {
@Test
- def test(): Unit = {
+ private def test(): Unit = {
def extract(data: java.util.List[java.util.Map[String, Object]]):
Seq[Double] =
data.asScala.map(_.get("score").asInstanceOf[Number].doubleValue())