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 f198e43  WIP.
f198e43 is described below

commit f198e439e5c0ec542de62713256076cbbd267336
Author: Aaron Radzinzski <[email protected]>
AuthorDate: Wed May 19 21:19:04 2021 -0700

    WIP.
---
 .../tools/test/impl/NCTestAutoModelValidatorImpl.scala     |  2 +-
 .../org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala    |  6 +++---
 .../nlpcraft/probe/mgrs/conversation/NCConversation.scala  |  2 +-
 .../nlpcraft/probe/mgrs/deploy/NCDeployManager.scala       | 14 +++++++-------
 .../probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala   |  6 +++---
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
index a4ee3dc..7d883c1 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
@@ -24,7 +24,7 @@ import 
org.apache.nlpcraft.model.tools.embedded.NCEmbeddedProbe
 import org.apache.nlpcraft.model.tools.test.{NCTestAutoModelValidator, 
NCTestClientBuilder}
 import org.apache.nlpcraft.probe.mgrs.model.NCModelManager
 
-import scala.collection.JavaConverters._
+import scala.jdk.CollectionConverters._
 
 /**
   * Implementation for `NCTestAutoModelValidator` class.
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala
index 283e5d4..b2ed60e 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala
@@ -134,8 +134,8 @@ class NCProbeSynonym(
                     state = -1
             }
 
-            if (state != -1 && all.size == res.size && (!shouldBeNeighbors || 
U.isIncreased(res.map(getIndex).sorted)))
-                Some(res)
+            if (state != -1 && all.size == res.size && (!shouldBeNeighbors || 
U.isIncreased(res.map(getIndex).sorted.toSeq)))
+                Some(res.toSeq)
             else
                 None
         }
@@ -207,7 +207,7 @@ class NCProbeSynonym(
         require(toks != null)
         require(sparse && !hasIdl)
 
-        sparseMatch0(toks, isMatch, (t: NCNlpSentenceToken) => 
t.startCharIndex, shouldBeNeighbors = false)
+        sparseMatch0(toks.toSeq, isMatch, (t: NCNlpSentenceToken) => 
t.startCharIndex, shouldBeNeighbors = false)
     }
 
     /**
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/conversation/NCConversation.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/conversation/NCConversation.scala
index 033b8af..035b7fb 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/conversation/NCConversation.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/conversation/NCConversation.scala
@@ -28,7 +28,7 @@ import org.apache.nlpcraft.common.ascii.NCAsciiTable
 import org.apache.nlpcraft.common.opencensus.NCOpenCensusTrace
 import org.apache.nlpcraft.model._
 
-import scala.collection.JavaConverters._
+import scala.jdk.CollectionConverters._
 import scala.collection.mutable
 
 /**
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
index 4444e41..a1b556c 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
@@ -39,17 +39,17 @@ import org.apache.nlpcraft.model.intent._
 import org.apache.nlpcraft.probe.mgrs.NCProbeSynonymChunkKind.{IDL, REGEX, 
TEXT}
 import org.apache.nlpcraft.probe.mgrs.{NCProbeModel, NCProbeSynonym, 
NCProbeSynonymChunk, NCProbeSynonymsWrapper}
 
-import scala.collection.JavaConverters._
 import scala.compat.java8.OptionConverters._
-import scala.collection.convert.DecorateAsScala
+import scala.jdk.CollectionConverters._
 import scala.collection.mutable
 import scala.collection.mutable.{ArrayBuffer, ListBuffer}
+import scala.util.Using
 import scala.util.control.Exception._
 
 /**
   * Model deployment manager.
   */
-object NCDeployManager extends NCService with DecorateAsScala {
+object NCDeployManager extends NCService {
     private final val TOKENS_PROVIDERS_PREFIXES = Set("nlpcraft:", "google:", 
"stanford:", "opennlp:", "spacy:")
     private final val ID_REGEX = "^[_a-zA-Z]+[a-zA-Z0-9:\\-_]*$"
 
@@ -323,7 +323,7 @@ object NCDeployManager extends NCService with 
DecorateAsScala {
                 chunks ++= U.splitTrimFilter(x.substring(start), " ")
 
                 chunks.map(mkChunk(mdl, _))
-            }
+            }.toSeq
 
             /**
               *
@@ -611,7 +611,7 @@ object NCDeployManager extends NCService with 
DecorateAsScala {
 
         val classes = mutable.ArrayBuffer.empty[Class[_ <: NCModel]]
 
-        managed(new JarInputStream(new BufferedInputStream(new 
FileInputStream(jarFile)))) acquireAndGet { in =>
+        Using.resource(new JarInputStream(new BufferedInputStream(new 
FileInputStream(jarFile)))) { in =>
             var entry = in.getNextJarEntry
 
             while (entry != null) {
@@ -641,7 +641,7 @@ object NCDeployManager extends NCService with 
DecorateAsScala {
                 makeModelFromSource(cls, jarFile.getPath)
             )
         )
-    }
+    }.toSeq
 
     /**
      *
@@ -716,7 +716,7 @@ object NCDeployManager extends NCService with 
DecorateAsScala {
       *
       * @return
       */
-    def getModels: Seq[NCProbeModel] = data
+    def getModels: Seq[NCProbeModel] = data.toSeq
 
     /**
       * Permutes and drops duplicated.
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala
index ddb4f83..3f5c171 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala
@@ -31,15 +31,15 @@ import org.apache.nlpcraft.probe.mgrs.{NCProbeModel, 
NCProbeVariants, NCProbeSyn
 import java.io.Serializable
 import java.util
 import java.util.{List => JList}
-import scala.collection.JavaConverters._
-import scala.collection.convert.DecorateAsScala
+
+import scala.jdk.CollectionConverters._
 import scala.collection.mutable.ArrayBuffer
 import scala.collection.{Map, Seq, mutable}
 
 /**
   * Model elements enricher.
   */
-object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
+object NCModelEnricher extends NCProbeEnricher {
     type TokType = (NCToken, NCSynonymChunkKind)
     type Cache = mutable.Map[String, ArrayBuffer[Seq[Int]]]
 

Reply via email to