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

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


The following commit(s) were added to refs/heads/scala-2.13 by this push:
     new 04eca13  WIP.
04eca13 is described below

commit 04eca13b9e19ae371fe463882bc87f25d4c750cf
Author: Aaron Radzinzski <[email protected]>
AuthorDate: Thu May 20 11:46:27 2021 -0700

    WIP.
---
 .../org/apache/nlpcraft/common/nlp/NCNlpSentence.scala   |  2 +-
 .../apache/nlpcraft/common/nlp/NCNlpSentenceNote.scala   |  2 +-
 .../org/apache/nlpcraft/probe/mgrs/NCProbeModel.scala    |  2 --
 .../org/apache/nlpcraft/probe/mgrs/NCProbeVariants.scala | 16 ++++++++--------
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentence.scala 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentence.scala
index 829a8fd..aca99fe 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentence.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentence.scala
@@ -222,7 +222,7 @@ class NCNlpSentence(
     /**
       *
       */
-    def getDeletedNotes: Predef.Map[NCNlpSentenceNote, 
Seq[NCNlpSentenceToken]] = deletedNotes.toMap
+    def getDeletedNotes: Map[NCNlpSentenceNote, Seq[NCNlpSentenceToken]] = 
deletedNotes.toMap
 
     /***
       *
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentenceNote.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentenceNote.scala
index 7d6b860..1c04ec6 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentenceNote.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentenceNote.scala
@@ -260,6 +260,6 @@ object NCNlpSentenceNote {
       * @param typ Type of the node.
       * @param params Parameters.
       */
-    def apply(indexes: collection.Seq[Int], wordIndexes: collection.Seq[Int], 
typ: String, params: (String, Any)*): NCNlpSentenceNote =
+    def apply(indexes: Seq[Int], wordIndexes: Seq[Int], typ: String, params: 
(String, Any)*): NCNlpSentenceNote =
         apply(indexes, Some(wordIndexes), typ, params: _*)
 }
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeModel.scala 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeModel.scala
index 03c5cb3..3c7043f 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeModel.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeModel.scala
@@ -21,8 +21,6 @@ import org.apache.nlpcraft.model.intent.NCIdlIntent
 import org.apache.nlpcraft.model.intent.solver.NCIntentSolver
 import org.apache.nlpcraft.model.{NCElement, NCModel}
 
-import scala.collection.{Map, Seq}
-
 /**
   *
   * @param model
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeVariants.scala 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeVariants.scala
index e682268..9fc1084 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeVariants.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeVariants.scala
@@ -25,7 +25,7 @@ import org.apache.nlpcraft.model._
 
 import java.util
 import java.util.Collections.singletonList
-import scala.collection._
+import scala.collection.mutable
 import scala.collection.mutable.ArrayBuffer
 import scala.jdk.CollectionConverters._
 
@@ -84,7 +84,7 @@ object NCProbeVariants {
         key: Key,
         delNotes: Map[NCNlpSentenceNote, Seq[NCNlpSentenceToken]],
         noteTypePred: String => Boolean
-    ): Option[NCNlpSentenceNote] =
+    ): Option[NCNlpSentenceToken] =
         delNotes.to(LazyList).
             flatMap { case (delNote, delNoteToks) =>
                 if (noteTypePred(delNote.noteType)) {
@@ -179,8 +179,8 @@ object NCProbeVariants {
             Seq(IDX.intValue()),
             srcToks.flatMap(_.wordIndexes).distinct.sorted,
             "nlpcraft:nlp",
-            params: _*)
-
+            params: _*
+        )
     }
 
     /**
@@ -312,16 +312,16 @@ object NCProbeVariants {
 
             if (bestVars.size != vars.size)
                 // Reverts orders.
-                vars = bestVars.sortBy(sortedVars.indexOf)
+                vars = bestVars.sortBy(sortedVars.indexOf).toSeq
         }
 
         for (v <- vars; t <- v.asScala)
             require(
                 t.getIndex >= 0,
                 s"Invalid token: $t with index: ${t.getIndex}, " +
-                    s"lastPhase: $lastPhase, " +
-                    s"sentence:\n${NCTokenLogger.prepareTable(v.asScala)}" +
-                    s""
+                s"lastPhase: $lastPhase, " +
+                s"sentence:\n${NCTokenLogger.prepareTable(v.asScala.toSeq)}" +
+                s""
             )
 
         vars

Reply via email to