You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2021/09/06 09:11:15 UTC

[incubator-nlpcraft] branch NLPCRAFT-431-430 updated: WIP.

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

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


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

commit 319379a73e9da653915bd1b86351f97d64833823
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Mon Sep 6 12:11:07 2021 +0300

    WIP.
---
 .../enrichers/numeric/NCEnricherNumericSpec.scala  | 34 ++++++++++++++--------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/numeric/NCEnricherNumericSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/numeric/NCEnricherNumericSpec.scala
index 1ff1c93..55044d2 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/numeric/NCEnricherNumericSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/numeric/NCEnricherNumericSpec.scala
@@ -33,25 +33,35 @@ class NCEnricherNumericSpec extends NCEnricherBaseSpec {
     @Test
     def test(): Unit =
         runBatch(
-            // Doesn't check `limit` for given sentence.
-            _ => checkExists(
-                "23 A",
-                num(text = "23 A", 23, 23, unit = Some("are")),
-            ),
-            _ => checkExists(
-                "23 A",
-                num(text = "23", 23, 23),
-                usr(text = "A", id = "A")
+            // Two variants.
+            _ => checkAll(
+                "23 meters",
+                Seq(
+                    num(text = "23 meters", 23, 23, unit = Some("meter"))
+                ),
+                Seq(
+                    num(text = "23", 23, 23),
+                    nlp(text = "meters")
+                )
             ),
 
+            // Two variants.
             _ => checkAll(
-                "23 mile",
+                "23 m",
                 Seq(
-                    num(text = "23 mile", 23, 23, unit = Some("mile"))
+                    num(text = "23 m", 23, 23, unit = Some("meter"))
                 ),
                 Seq(
                     num(text = "23", 23, 23),
-                    nlp(text = "mile")
+                    nlp(text = "m")
+                )
+            ),
+
+            // One variant.
+            _ => checkAll(
+                "23m",
+                Seq(
+                    num(text = "23m", 23, 23, unit = Some("meter"))
                 )
             )
         )