You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2022/08/25 17:19:51 UTC

[incubator-nlpcraft] branch NLPCRAFT-500 updated: WIP

This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch NLPCRAFT-500
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-500 by this push:
     new 8441c263 WIP
8441c263 is described below

commit 8441c26302634a4eb5c80db5883088e60eb40575
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Thu Aug 25 10:19:43 2022 -0700

    WIP
---
 .../main/scala/org/apache/nlpcraft/NCResult.scala   | 21 +++++++++++++++++++++
 .../internal/intent/compiler/NCIDLCompiler.scala    |  7 +++----
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCResult.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCResult.scala
index 0dfaca5c..db9d865c 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCResult.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCResult.scala
@@ -21,24 +21,45 @@ package org.apache.nlpcraft
   *
   */
 object NCResult:
+    /**
+      * 
+      * @param body
+      * @param resultType
+      * @param intentId
+      * @return
+      */
     def apply(body: Any, resultType: NCResultType, intentId: String): NCResult =
         new NCResult():
             def getBody: Any = body
             def getType: NCResultType = resultType
             def getIntentId: Option[String] = Option(intentId)
 
+    /**
+      * 
+      * @param body
+      * @param resultType
+      * @return
+      */
     def apply(body: Any, resultType: NCResultType): NCResult =
         new NCResult():
             def getBody: Any = body
             def getType: NCResultType = resultType
             def getIntentId: Option[String] = None
 
+    /**
+      * 
+      * @param body
+      * @return
+      */
     def apply(body: Any): NCResult =
         new NCResult() :
             def getBody: Any = body
             def getType: NCResultType = NCResultType.ASK_RESULT
             def getIntentId: Option[String] = None
 
+/**
+  * 
+  */
 trait NCResult:
     def getBody: Any
     def getType: NCResultType
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompiler.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompiler.scala
index c75987b4..fbf0cf53 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompiler.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCompiler.scala
@@ -274,12 +274,11 @@ class NCIDLCompiler(cfg: NCModelConfig) extends LazyLogging with mutable.Cloneab
             val frag = NCIDLFragment(fragId, terms.toList)
 
             fragCache.get(frag.id) match
-                case Some(exFrag) =>
-                    // TODO: text
+                case Some(_) =>
                     if isMethodLevel then
-                        logger.warn(s"Fragment '${frag.id}' was overriden just for for origin: '${this.origin}'.")
+                        logger.warn(s"Fragment '${frag.id}' was overridden just for the scope of: '${this.origin}'")
                     else
-                        logger.warn(s"Fragment '${frag.id}' was overriden in origin: '${this.origin}' permanently.")
+                        logger.warn(s"Fragment '${frag.id}' was overridden in origin: '${this.origin}'")
                 case None => // No-op.
 
             fragCache += frag.id -> frag