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

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


The following commit(s) were added to refs/heads/master by this push:
     new 72efe75  Minor fixes.
72efe75 is described below

commit 72efe75cff941b76f70f04d9f1e1f720eefdd1cb
Author: Sergey Kamov <[email protected]>
AuthorDate: Mon Apr 19 13:15:05 2021 +0300

    Minor fixes.
---
 .../apache/nlpcraft/probe/mgrs/sentence/NCSentenceManager.scala  | 9 +++++++++
 1 file changed, 9 insertions(+)

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 f77e035..de6453d 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
@@ -754,6 +754,15 @@ object NCSentenceManager extends NCService {
             }).
             toSeq
 
+        sens =
+            sens.filter(s ⇒ {
+                def mkNotNlp(s: NCNlpSentence): Set[NCNlpSentenceNote] = 
s.flatten.filter(!_.isNlp).toSet
+
+                val notNlpNotes = mkNotNlp(s)
+
+                !sens.filter(_ != s).map(mkNotNlp).exists(notNlpNotes.subsetOf)
+            })
+
         // Drops similar sentences (with same tokens structure).
         // Among similar sentences we prefer one with minimal free words count.
         sens.groupBy(notNlpNotes(_).map(_.getKey(withIndexes = false))).

Reply via email to