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/01/20 12:07:31 UTC

[incubator-nlpcraft] branch master updated: NCDeployManager bugfixes.

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 36de483  NCDeployManager bugfixes.
36de483 is described below

commit 36de4835c17454979421077905603e71d44bd141
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Wed Jan 20 15:06:23 2021 +0300

    NCDeployManager bugfixes.
---
 .../apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
index d7f6d2a..1119c27 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
@@ -207,7 +207,7 @@ object NCDeployManager extends NCService with DecorateAsScala {
                     if (syns.add(holder)) {
                         cnt += 1
 
-                        if (cnt > maxCnt)
+                        if (mdl.isMaxSynonymsThresholdError && cnt > maxCnt)
                             throw new NCE(s"Too many total synonyms detected [" +
                                 s"mdlId=$mdlId, " +
                                 s"cnt=$cnt, " +
@@ -369,6 +369,15 @@ object NCDeployManager extends NCService with DecorateAsScala {
             }
         }
 
+        if (cnt > maxCnt && !mdl.isMaxSynonymsThresholdError)
+            logger.warn(
+                s"Too many total synonyms detected [" +
+                  s"mdlId=$mdlId, " +
+                  s"cnt=$cnt, " +
+                  s"max=$maxCnt" +
+                  s"]"
+            )
+
         // Discard value loaders.
         for (elm ← mdl.getElements.asScala) {
             val ldr = elm.getValueLoader