This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-443
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-443 by this push:
new bc301f2 WIP.
bc301f2 is described below
commit bc301f2ce10591f69c36c9a68425c9eee1c2cf11
Author: Sergey Kamov <[email protected]>
AuthorDate: Sat Sep 25 10:50:46 2021 +0300
WIP.
---
.../main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentence.scala | 2 +-
.../org/apache/nlpcraft/probe/mgrs/sentence/NCSentenceManager.scala | 6 +++---
2 files changed, 4 insertions(+), 4 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 40f5da6..588706a 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
@@ -59,7 +59,7 @@ class NCNlpSentence(
@transient
private var hash: java.lang.Integer = _
- private def calcHash(): Int = U.mkJavaHash(srvReqId, text,
enabledBuiltInToks, tokens)
+ private def calcHash(): Int = tokens.hashCode()
// Deep copy.
override def clone(): NCNlpSentence =
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 09904d2..42b5583 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
@@ -600,7 +600,7 @@ object NCSentenceManager extends NCService {
if (lastPhase)
dropAbstract(mdl, ns)
- if (collapseSentence(ns,
getNotNlpNotes(ns.toSeq).map(_.noteType).distinct, lastPhase)) Some(ns) else
None
+ if (collapseSentence(ns,
getNotNlpNotes(ns.tokens).map(_.noteType).distinct, lastPhase)) Some(ns) else
None
}
// Always deletes `similar` notes.
@@ -633,8 +633,8 @@ object NCSentenceManager extends NCService {
redundant.foreach(sen.removeNote)
var delCombs: Seq[NCNlpSentenceNote] =
- getNotNlpNotes(sen.toSeq).
- flatMap(note => getNotNlpNotes(note.tokenIndexes.sorted.map(i
=> sen(i))).filter(_ != note)).
+ getNotNlpNotes(sen.tokens).
+ flatMap(note =>
getNotNlpNotes(note.tokenIndexes.map(sen(_))).filter(_ != note)).
distinct
// Optimization. Deletes all wholly swallowed notes.