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

sergeykamov pushed a commit to branch NLPCRAFT-431
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-431 by this push:
     new e126c9e  WIP.
e126c9e is described below

commit e126c9ecfb61757731deacc9a06572992fc6c991
Author: Sergey Kamov <[email protected]>
AuthorDate: Thu Sep 2 12:45:38 2021 +0300

    WIP.
---
 .../mgrs/nlp/enrichers/model/anyword/NCNestedAnySpec.scala |  6 ++++++
 .../model/anyword/regex/NCNestedTestModelAnyRegex1.scala   |  6 ++++++
 .../model/anyword/regex/NCNestedTestModelAnyRegex2.scala   |  6 ++++++
 .../model/anyword/regex/NCNestedTestModelAnyRegex3.scala   |  6 ++++++
 .../model/anyword/regex/NCNestedTestModelAnyRegex4.scala   |  8 +++++++-
 .../model/anyword/regex/NCNestedTestModelAnyRegex5.scala   | 14 ++++++++++----
 ...delAnyRegex5.scala => NCNestedTestModelAnyRegex7.scala} | 12 +++++++++---
 7 files changed, 50 insertions(+), 8 deletions(-)

diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/NCNestedAnySpec.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/NCNestedAnySpec.scala
index 8bd0260..4e1a84e 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/NCNestedAnySpec.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/NCNestedAnySpec.scala
@@ -52,6 +52,12 @@ class NCNestedAnySpec extends NCTestContext {
     @Test @NCTestEnvironment(model = classOf[NCNestedTestModelAnyRegex5], 
startClient = true)
     def testRegex5(): Unit = test()
 
+    @Test @NCTestEnvironment(model = classOf[NCNestedTestModelAnyRegex6], 
startClient = true)
+    def testRegex6(): Unit = test()
+
+    @Test @NCTestEnvironment(model = classOf[NCNestedTestModelAnyRegex7], 
startClient = true)
+    def testRegex7(): Unit = test()
+
     @Test @NCTestEnvironment(model = classOf[NCNestedTestModelAnyAlphaNum1], 
startClient = true)
     def testAlphaNum1(): Unit = test()
 
diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex1.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex1.scala
index 42fd9bc..334aacb 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex1.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex1.scala
@@ -33,6 +33,12 @@ import scala.jdk.CollectionConverters.SetHasAsJava
 class NCNestedTestModelAnyRegex1 extends NCNestedModelAnyAdapter {
     override def getAbstractTokens: util.Set[String] = Set("a", "b", 
"any").asJava
 
+    // Variants:
+    // a t1 t2 t3 b - 1
+    // a t1 t2 b - 1
+    // a t1 b - 1
+    // a t1 t2 t3 t4 b - 1
+    // a b - 1
     override def getElements: util.Set[NCElement] =
         Set(
             NCTestElement("a"),
diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex2.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex2.scala
index 2f0b433..5252b83 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex2.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex2.scala
@@ -33,6 +33,12 @@ import scala.jdk.CollectionConverters.SetHasAsJava
 class NCNestedTestModelAnyRegex2 extends NCNestedModelAnyAdapter {
     override def getAbstractTokens: util.Set[String] = Set("a", "b", 
"any").asJava
 
+    // Variants:
+    // a t1 t2 t3 b - 1
+    // a t1 t2 b - 1
+    // a t1 b - 1
+    // a t1 t2 t3 t4 b - 1
+    // a b - 1
     override def getElements: util.Set[NCElement] =
         Set(
             NCTestElement("a"),
diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex3.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex3.scala
index 5029674..9af7e88 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex3.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex3.scala
@@ -32,6 +32,12 @@ import scala.jdk.CollectionConverters.SetHasAsJava
 class NCNestedTestModelAnyRegex3 extends NCNestedModelAnyAdapter {
     override def getAbstractTokens: util.Set[String] = Set("a", "b").asJava
 
+    // Variants:
+    // a t1 t2 t3 b - 1
+    // a t1 t2 b - 1
+    // a t1 b - 1
+    // a t1 t2 t3 t4 b - 1
+    // a b - 1
     override def getElements: util.Set[NCElement] =
         Set(
             NCTestElement("a"),
diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex4.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex4.scala
index 8b9b30c..f17b651 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex4.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex4.scala
@@ -33,6 +33,12 @@ import scala.jdk.CollectionConverters.SetHasAsJava
 class NCNestedTestModelAnyRegex4 extends NCNestedModelAnyAdapter {
     override def getAbstractTokens: util.Set[String] = Set.empty[String].asJava
 
+    // Variants:
+    // a t1 t2 t3 b - 13
+    // a t1 t2 b - 11
+    // a t1 b - 8
+    // a t1 t2 t3 t4 b - 16
+    // a b - 5
     override def getElements: util.Set[NCElement] =
         Set(
             NCTestElement("a"),
@@ -43,7 +49,7 @@ class NCNestedTestModelAnyRegex4 extends 
NCNestedModelAnyAdapter {
     @NCIntent(
         "intent=compose options={'ordered': true, 'unused_free_words': false} 
" +
         "    term(a)={# == 'a'}" +
-        "    term(any)={# == 'any'}[1,3] " +
+        "    term(any)={# == 'any'} " +
         "    term(b)={# == 'b'}"
     )
     private def onCompose(): NCResult = NCResult.text("OK")
diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex5.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex5.scala
index 03d12ac..3293dfe 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex5.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex5.scala
@@ -28,23 +28,29 @@ import scala.jdk.CollectionConverters.SetHasAsJava
   * 'any' ('not greedy') element - regex.
   * no 'compose' element.
   * intent with DSL.
-  * 'any' element's position is restricted (IDL).
+  * 'any' element's position is not restricted (IDL).
   */
 class NCNestedTestModelAnyRegex5 extends NCNestedModelAnyAdapter {
     override def getAbstractTokens: util.Set[String] = Set.empty[String].asJava
 
+    // Variants:
+    // a t1 t2 t3 b - 4
+    // a t1 t2 b - 4
+    // a t1 b - 4
+    // a t1 t2 t3 t4 b - 4
+    // a b - 4
     override def getElements: util.Set[NCElement] =
         Set(
             NCTestElement("a"),
             NCTestElement("b"),
-            mkNotGreedy("any", "{//[a-zA-Z0-9]+//}[1, 3]")
+            mkNotGreedy("any", "{//[a-zA-Z0-9]+//}")
         )
 
     @NCIntent(
         "intent=compose options={'ordered': true, 'unused_free_words': false} 
" +
         "    term(a)={# == 'a'}" +
-        "    term(any)={# == 'any' && tok_is_between_ids('a', 'b') == 
true}[1,3] " +
+        "    term(any)={# == 'any'}[1, 3] " +
         "    term(b)={# == 'b'}"
-        )
+    )
     private def onCompose(): NCResult = NCResult.text("OK")
 }
\ No newline at end of file
diff --git 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex5.scala
 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex7.scala
similarity index 87%
copy from 
nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex5.scala
copy to 
nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex7.scala
index 03d12ac..8135540 100644
--- 
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex5.scala
+++ 
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/anyword/regex/NCNestedTestModelAnyRegex7.scala
@@ -30,20 +30,26 @@ import scala.jdk.CollectionConverters.SetHasAsJava
   * intent with DSL.
   * 'any' element's position is restricted (IDL).
   */
-class NCNestedTestModelAnyRegex5 extends NCNestedModelAnyAdapter {
+class NCNestedTestModelAnyRegex7 extends NCNestedModelAnyAdapter {
     override def getAbstractTokens: util.Set[String] = Set.empty[String].asJava
 
+    // Variants:
+    // a t1 t2 t3 b - 4
+    // a t1 t2 b - 4
+    // a t1 b - 4
+    // a t1 t2 t3 t4 b - 4
+    // a b - 4
     override def getElements: util.Set[NCElement] =
         Set(
             NCTestElement("a"),
             NCTestElement("b"),
-            mkNotGreedy("any", "{//[a-zA-Z0-9]+//}[1, 3]")
+            mkNotGreedy("any", "{//[a-zA-Z0-9]+//}")
         )
 
     @NCIntent(
         "intent=compose options={'ordered': true, 'unused_free_words': false} 
" +
         "    term(a)={# == 'a'}" +
-        "    term(any)={# == 'any' && tok_is_between_ids('a', 'b') == 
true}[1,3] " +
+        "    term(any)={# == 'any' && tok_is_between_ids('a', 'b') == true}[1, 
3] " +
         "    term(b)={# == 'b'}"
         )
     private def onCompose(): NCResult = NCResult.text("OK")

Reply via email to