You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by if...@apache.org on 2020/05/30 03:57:59 UTC

[incubator-nlpcraft] branch master updated: Add new test scenarios for limit and sort enrichers

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

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


The following commit(s) were added to refs/heads/master by this push:
     new b836815  Add new test scenarios for limit and sort enrichers
b836815 is described below

commit b83681510abcaeb21355d996d9a605ce423de9c1
Author: Ifropc <if...@apache.org>
AuthorDate: Fri May 29 20:57:47 2020 -0700

    Add new test scenarios for limit and sort enrichers
---
 .../mgrs/nlp/enrichers/limit/NCEnricherLimitSpec.scala |  5 +++++
 .../mgrs/nlp/enrichers/sort/NCEnricherSortSpec.scala   | 18 +++++++++++++-----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/limit/NCEnricherLimitSpec.scala b/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/limit/NCEnricherLimitSpec.scala
index 2ba3638..d882790 100644
--- a/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/limit/NCEnricherLimitSpec.scala
+++ b/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/limit/NCEnricherLimitSpec.scala
@@ -45,6 +45,11 @@ class NCEnricherLimitSpec extends NCEnricherBaseSpec {
                 "top 10 D1",
                 lim(text = "top 10", limit = 10, index = 1, note = "D1", asc = false),
                 usr(text = "D1", id = "D1")
+            ),
+            _ ⇒ checkExists(
+                "handful of A B",
+                lim(text = "handful of", limit = 5, index = 1, note = "AB", asc = false),
+                usr(text = "A B", id = "AB")
             )
         )
     }
diff --git a/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/sort/NCEnricherSortSpec.scala b/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/sort/NCEnricherSortSpec.scala
index 815f7fa..cf2081e 100644
--- a/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/sort/NCEnricherSortSpec.scala
+++ b/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/sort/NCEnricherSortSpec.scala
@@ -27,13 +27,13 @@ import org.apache.nlpcraft.probe.mgrs.nlp.enrichers.{
 import org.junit.jupiter.api.Test
 
 /**
-  * Sort enricher test.
-  */
+ * Sort enricher test.
+ */
 class NCEnricherSortSpec extends NCEnricherBaseSpec {
     /**
-      *
-      * @throws Exception
-      */
+     *
+     * @throws Exception
+     */
     @Test
     def test(): Unit =
         runBatch(
@@ -199,6 +199,14 @@ class NCEnricherSortSpec extends NCEnricherBaseSpec {
                 nlp(text = ",", isStop = true),
                 usr(text = "B", id = "B"),
                 nlp(text = "the descending", isStop = true)
+            ),
+            _ ⇒ checkExists(
+                "organize by A, B, asc",
+                srt(text = "organize by", byNotes = Seq("A", "B"), byIndexes = Seq(1, 3), asc = Some(true)),
+                usr(text = "A", id = "A"),
+                nlp(text = ",", isStop = true),
+                usr(text = "B", id = "B"),
+                nlp(text = ", asc", isStop = true)
             )
         )
 }