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 2020/03/15 11:37:44 UTC
[incubator-nlpcraft] branch NLPCRAFT-16 updated: WIP.
This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-16
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-16 by this push:
new 00518e1 WIP.
00518e1 is described below
commit 00518e1f7e84ad848b66e7aaba4a80c585de7c5b
Author: Sergey Kamov <se...@apache.org>
AuthorDate: Sun Mar 15 14:37:39 2020 +0300
WIP.
---
.../probe/mgrs/nlp/enrichers/NCEnrichersTestBeans.scala | 8 ++++----
.../NCEnricherLimitSpec.scala} | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/NCEnrichersTestBeans.scala b/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/NCEnrichersTestBeans.scala
index 5fa79ae..86f7ad3 100644
--- a/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/NCEnrichersTestBeans.scala
+++ b/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/NCEnrichersTestBeans.scala
@@ -99,8 +99,8 @@ case class NCTestLimitToken(limit: Double, indexes: Seq[Int], note: String, asc:
override def id: String = "nlpcraft:limit"
}
-// Token and sentence.
-case class NCTestToken(origText: String, isStop: Boolean, note: NCTestTokenKind)
+// Token and sentence beans and utilities.
+case class NCTestToken(origText: String, isStop: Boolean, token: NCTestTokenKind)
object NCTestToken {
def apply(t: NCToken): NCTestToken = {
@@ -142,9 +142,9 @@ object NCTestToken {
case "nlpcraft:limit" ⇒
NCTestLimitToken(
limit = t.meta("limit"),
+ asc = t.meta("asc"),
indexes = t.meta("indexes"),
- note = t.meta("note"),
- asc = t.meta("note")
+ note = t.meta("note")
)
case _ ⇒ throw new AssertionError(s"Unsupported token: ${t.getId}")
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/limit/NCEnricherLimitSpec.scala
similarity index 78%
rename from src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/sort/NCEnricherSortSpec.scala
rename to src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/limit/NCEnricherLimitSpec.scala
index 1fb75a2..9f23c76 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/limit/NCEnricherLimitSpec.scala
@@ -15,15 +15,15 @@
* limitations under the License.
*/
-package org.apache.nlpcraft.probe.mgrs.nlp.enrichers.sort
+package org.apache.nlpcraft.probe.mgrs.nlp.enrichers.limit
-import org.apache.nlpcraft.probe.mgrs.nlp.enrichers.{NCEnricherBaseSpec, NCTestRelationToken, NCTestToken}
+import org.apache.nlpcraft.probe.mgrs.nlp.enrichers.{NCEnricherBaseSpec, NCTestLimitToken ⇒ LT, NCTestToken ⇒ T}
import org.junit.jupiter.api.Test
/**
- * Sort enricher tests.
+ * Limit enricher tests.
*/
-class NCEnricherSortSpec extends NCEnricherBaseSpec {
+class NCEnricherLimitSpec extends NCEnricherBaseSpec {
/**
*
* @throws Exception
@@ -32,7 +32,7 @@ class NCEnricherSortSpec extends NCEnricherBaseSpec {
def test(): Unit = {
check(
"sort a1 by b1",
- NCTestToken(origText = "text", isStop = false, note = NCTestRelationToken("a", Seq(1), "test"))
+ T(origText = "text", isStop = false, token = LT(1, Seq(1), "a", Some(true)))
)
}
}