You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2021/02/19 15:44:03 UTC
[incubator-nlpcraft] branch NLPCRAFT-246 updated: Minor fixes.
This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-246
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-246 by this push:
new 6ddc875 Minor fixes.
new 81ed8b1 Merge branch 'master' into NLPCRAFT-246
6ddc875 is described below
commit 6ddc8753a5f37411a04a236bdb0141064613259e
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Fri Feb 19 18:38:16 2021 +0300
Minor fixes.
---
.../main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentence.scala | 5 +++--
1 file changed, 3 insertions(+), 2 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 e7aecd3..c479308 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
@@ -672,7 +672,7 @@ class NCNlpSentence(
var sens =
if (delCombs.nonEmpty) {
- val deleted = mutable.ArrayBuffer.empty[Seq[NCNlpSentenceNote]]
+ val deleted = mutable.ArrayBuffer.empty[Set[NCNlpSentenceNote]]
val sens =
(minDelSize to delCombs.size).
@@ -681,9 +681,10 @@ class NCNlpSentence(
filter(delComb ⇒ !toksByIdx.exists(_.count(note ⇒ !delComb.contains(note)) > 1))
).
sortBy(_.size).
+ map(_.toSet).
flatMap(delComb ⇒
// Already processed with less subset of same deleted tokens.
- if (!deleted.exists(_.forall(delComb.contains))) {
+ if (!deleted.exists(_.subsetOf(delComb))) {
val nsClone = this.clone()
// Saves deleted notes for sentence and their tokens.