This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-443-1
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-443-1 by this push:
new 2db3868 WIP.
2db3868 is described below
commit 2db3868f4e99829a6f737d60b1175b2e5cba0eff
Author: Sergey Kamov <[email protected]>
AuthorDate: Wed Sep 22 16:55:20 2021 +0300
WIP.
---
.../probe/mgrs/sentence/NCSynonymsManager.scala | 25 ++++++----------------
1 file changed, 6 insertions(+), 19 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/sentence/NCSynonymsManager.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/sentence/NCSynonymsManager.scala
index e6258ec..81e9132 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/sentence/NCSynonymsManager.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/sentence/NCSynonymsManager.scala
@@ -274,19 +274,6 @@ object NCSynonymsManager extends NCService {
/**
*
* @param srvReqId
- */
- def getPredicate(srvReqId: String) : Option[(NCRequest, Map[IdlCacheKey,
NCIdlFunction])] = {
- val reqData = reqCache.get(srvReqId)
- val idlData = idlCache.get(srvReqId)
-
- require(reqData.isDefined && idlData.isDefined || reqData.isEmpty &&
idlData.isEmpty)
-
- if (reqData.isDefined) Some((reqData.get, idlData.get.toMap)) else None
- }
-
- /**
- *
- * @param srvReqId
* @param toks
* @return
*/
@@ -297,20 +284,20 @@ object NCSynonymsManager extends NCService {
require(reqData.isDefined && idlData.isDefined || reqData.isEmpty &&
idlData.isEmpty)
if (reqData.isDefined) {
- val req = reqData.get
- val idl = idlData.get.toMap
+ val req: NCRequest = reqData.get
+ val idl: Map[IdlCacheKey, NCIdlFunction] = idlData.get.toMap
- toks.forall(t =>
- idl.get((t, t.getId)) match {
+ toks.forall(tok =>
+ idl.get((tok, tok.getId)) match {
case Some(f) =>
val x =
f.apply(
- t, NCIdlContext(req = req, toks = toks)
+ tok, NCIdlContext(req = req, toks = toks)
).value.asInstanceOf[Boolean]
if (!x)
- println("x="+x + ", t=" + t + ", toks=" + toks)
+ println("x="+x + ", t=" + tok + ", toks=" + toks)
x