This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-30
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-30 by this push:
new 45e32b8 WIP.
45e32b8 is described below
commit 45e32b854abddec1e154c2e8266520e163e7efa9
Author: Sergey Kamov <[email protected]>
AuthorDate: Wed Apr 29 22:34:59 2020 +0300
WIP.
---
.../probe/mgrs/nlp/enrichers/utils/NCEnricherProcessor.scala | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git
a/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/utils/NCEnricherProcessor.scala
b/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/utils/NCEnricherProcessor.scala
index 08b73ba..6bec7cd 100644
---
a/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/utils/NCEnricherProcessor.scala
+++
b/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/utils/NCEnricherProcessor.scala
@@ -33,6 +33,7 @@ import org.apache.nlpcraft.probe.mgrs.NCModelDecorator
import scala.collection.JavaConverters._
import scala.collection._
+
/**
*
*/
@@ -336,10 +337,6 @@ object NCEnricherProcessor extends NCService with
LazyLogging {
): Unit = {
// Java collection used because using scala collections
(mutable.Buffer.empty[mutable.Buffer[Token]]) is reason
// Of compilation errors which seems as scala compiler internal error.
- import java.util
-
- import scala.collection.JavaConverters._
-
val bufs = new util.ArrayList[mutable.Buffer[NCNlpSentenceToken]]()
def last[T](l: util.List[T]): T = l.get(l.size() - 1)
@@ -765,7 +762,8 @@ object NCEnricherProcessor extends NCService with
LazyLogging {
}
def extract(n: NCNlpSentenceNote, refIdxName: String):
Set[NCNlpSentenceToken] =
- n.getOrElse(refIdxName,
Collections.emptyList).asInstanceOf[java.util.List[Int]].asScala.map(sen(_)).toSet
+ n.getOrElse(refIdxName,
Collections.emptyList).asInstanceOf[java.util.List[java.util.List[Int]]].asScala.
+ flatMap(_.asScala.map(sen(_))).toSet
def referencesEqualOrNearly(n1: NCNlpSentenceNote, n2:
NCNlpSentenceNote): Boolean =
refIdxNames.isEmpty || refIdxNames.forall(refIdxName ⇒ {