This is an automated email from the ASF dual-hosted git repository. sergeykamov pushed a commit to branch NLPCRAFT-287 in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
commit 43ef6d3acf0b2367b8e40d9f5fe707a747d8c8d7 Author: Sergey Kamov <[email protected]> AuthorDate: Tue Apr 6 12:36:17 2021 +0300 WIP. --- .../org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala index c54b347..e541f04 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala @@ -116,7 +116,7 @@ class NCProbeSynonym( else { all ++= seq - if (all.size > res.size) + if (all.size > this.size) state = -1 else res += head @@ -182,13 +182,20 @@ class NCProbeSynonym( * @param toks * @return */ - def trySparseMatch(toks: NCNlpSentenceTokenBuffer): Option[Seq[NCNlpSentenceToken]] = - trySparseMatch0( + def trySparseMatch(toks: NCNlpSentenceTokenBuffer): Option[Seq[NCNlpSentenceToken]] = { + val res = trySparseMatch0( toks, isMatch, (t: NCNlpSentenceToken) ⇒ t.startCharIndex ) + println("toks="+toks.map(_.origText)) + println("res=" + res.isDefined) + println + + res + } + /** * * @param tows
