This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-261
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-261 by this push:
new a86228a WIP.
a86228a is described below
commit a86228a466185fcd358e67ef9507772f6073bc4c
Author: Sergey Kamov <[email protected]>
AuthorDate: Tue Mar 9 16:24:23 2021 +0300
WIP.
---
.../nlpcraft/probe/mgrs/sentence/NCSentenceManager.scala | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/sentence/NCSentenceManager.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/sentence/NCSentenceManager.scala
index a761936..9227859 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/sentence/NCSentenceManager.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/sentence/NCSentenceManager.scala
@@ -28,7 +28,7 @@ import java.io.{Serializable ⇒ JSerializable}
import java.util
import java.util.{List ⇒ JList}
import scala.collection.JavaConverters.{asScalaBufferConverter, _}
-import scala.collection.{Map, Seq, Set, mutable}
+import scala.collection.{Map, Seq, mutable}
import scala.language.implicitConversions
/**
@@ -672,14 +672,14 @@ object NCSentenceManager extends NCService {
addDeleted(sen, sen, swallowed)
swallowed.foreach(sen.removeNote)
- val toksByIdx =
- delCombs.flatMap(note ⇒ note.wordIndexes.map(_ → note)).
- groupBy { case (idx, _) ⇒ idx }.
- map { case (_, seq) ⇒ seq.map { case (_, note) ⇒ note }.toSet
}.
- toSeq.sortBy(-_.size)
-
var sens =
if (delCombs.nonEmpty) {
+ val toksByIdx =
+ delCombs.flatMap(note ⇒ note.wordIndexes.map(_ → note)).
+ groupBy { case (idx, _) ⇒ idx }.
+ map { case (_, seq) ⇒ seq.map { case (_, note) ⇒ note
}.toSet }.
+ toSeq.sortBy(-_.size)
+
val sens =
NCComboHelper.findCombinations(toksByIdx.map(_.asJava).asJava,
pool).asScala.map(_.asScala).
flatMap(delComb ⇒ {