This is an automated email from the ASF dual-hosted git repository.

sergeykamov 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 c073a74  WIP.
c073a74 is described below

commit c073a74f6a8592a32da018d4be3c9291c1d0fedf
Author: Sergey Kamov <[email protected]>
AuthorDate: Thu Mar 18 15:24:59 2021 +0300

    WIP.
---
 .../model/NCEnricherNestedModelSpec4.scala         |  2 +-
 ...pec4.scala => NCEnricherNestedModelSpec5.scala} | 29 +++++++++++-----------
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec4.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec4.scala
index 9bbe7a6..d308f56 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec4.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec4.scala
@@ -28,7 +28,7 @@ import scala.collection.JavaConverters._
   * Nested Elements test model.
   */
 class NCNestedTestModel4 extends NCModelAdapter(
-    "nlpcraft.nested3.test.mdl", "Nested Data Test Model", "1.0"
+    "nlpcraft.nested4.test.mdl", "Nested Data Test Model", "1.0"
 ) {
     override def getElements: util.Set[NCElement] =
         Set(
diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec4.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec5.scala
similarity index 64%
copy from 
nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec4.scala
copy to 
nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec5.scala
index 9bbe7a6..f484268 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec4.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec5.scala
@@ -27,27 +27,28 @@ import scala.collection.JavaConverters._
 /**
   * Nested Elements test model.
   */
-class NCNestedTestModel4 extends NCModelAdapter(
-    "nlpcraft.nested3.test.mdl", "Nested Data Test Model", "1.0"
+class NCNestedTestModel5 extends NCModelAdapter(
+    "nlpcraft.nested5.test.mdl", "Nested Data Test Model", "1.0"
 ) {
     override def getElements: util.Set[NCElement] =
         Set(
-            NCTestElement("e1", "//[a-zA-Z0-9]+//"),
-            NCTestElement("e2", "the ^^{id() == 'e1'}^^")
+            NCTestElement("cityWrapper", "^^[cityAlias]{id() == 
'nlpcraft:city'}^^"),
         )
-
-    override def getAbstractTokens: util.Set[String] = Set("e1").asJava
-    override def getEnabledBuiltInTokens: util.Set[String] = 
Set.empty[String].asJava
-
-    @NCIntent("intent=onE2 term(t1)={id() == 'e2'}[8, 100]")
-    def onAB(ctx: NCIntentMatch): NCResult = NCResult.text("OK")
+    @NCIntent(
+        "intent=bigCity " +
+        "term(city)={" +
+        "    id() == 'cityWrapper' && " +
+        "    meta_part(part(this(), 'cityAlias'), 'nlpcraft:city:citymeta') >= 
10381222" +
+        "}"
+    )
+    private def onBigCity(ctx: NCIntentMatch): NCResult = NCResult.text("OK")
 }
 
 /**
-  * It shouldn't be too slow.
+  *
   */
-@NCTestEnvironment(model = classOf[NCNestedTestModel4], startClient = true)
-class NCEnricherNestedModelSpec4 extends NCTestContext {
+@NCTestEnvironment(model = classOf[NCNestedTestModel5], startClient = true)
+class NCEnricherNestedModelSpec5 extends NCTestContext {
     @Test
-    def test(): Unit = checkIntent("the a " * 11, "onE2")
+    def test(): Unit = checkIntent("moscow", "bigCity")
 }
\ No newline at end of file

Reply via email to