This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-41
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-41 by this push:
new 3eb4815 WIP.
3eb4815 is described below
commit 3eb481551ca0e084a4acb5fc7fbdd88186995bd0
Author: Aaron Radzinski <[email protected]>
AuthorDate: Mon Sep 14 10:38:47 2020 -0700
WIP.
---
.../src/main/scala/org/apache/nlpcraft/common/NCService.scala | 2 +-
.../scala/org/apache/nlpcraft/common/ascii/NCAsciiTable.scala | 6 +++---
.../model/tools/test/impl/NCTestAutoModelValidatorImpl.scala | 9 +++++----
.../apache/nlpcraft/probe/mgrs/conversation/NCConversation.scala | 2 +-
4 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/NCService.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/NCService.scala
index f6869b1..79f72a7 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/NCService.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/NCService.scala
@@ -51,7 +51,7 @@ abstract class NCService extends LazyLogging with
NCOpenCensusTrace {
started = true
- val dur = s"$ansiGreenFg[${currentTime - startMs}ms]$ansiReset"
+ val dur = s"$ansiBlueFg[${currentTime - startMs}ms]$ansiReset"
logger.info(s"$clsName started $dur")
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/ascii/NCAsciiTable.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/ascii/NCAsciiTable.scala
index fc62dc9..c5f0ba7 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/ascii/NCAsciiTable.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/ascii/NCAsciiTable.scala
@@ -115,10 +115,10 @@ class NCAsciiTable {
// Table drawing symbols.
private val HDR_HOR = s"$ansiCyanFg=$ansiReset"
private val HDR_VER = s"$ansiCyanFg|$ansiReset"
- private val HDR_CRS = s"$ansiCyanFg+$ansiReset"
+ private val HDR_CRS = s"$ansiBlueFg+$ansiReset"
private val ROW_HOR = s"$ansiCyanFg-$ansiReset"
private val ROW_VER = s"$ansiCyanFg|$ansiReset"
- private val ROW_CRS = s"$ansiCyanFg+$ansiReset"
+ private val ROW_CRS = s"$ansiBlueFg+$ansiReset"
// Headers & rows.
private var hdr = IndexedSeq.empty[Cell]
@@ -370,7 +370,7 @@ class NCAsciiTable {
var strLines = lines.map(x)
if (hdr)
- strLines = strLines.map(s ⇒ s"$ansiGreenFg$s$ansiReset")
+ strLines = strLines.map(s ⇒ s"$ansiBlueFg$s$ansiReset")
Cell(
st,
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
index a9bebc0..7469f5c 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
@@ -19,11 +19,12 @@ package org.apache.nlpcraft.model.tools.test.impl
import com.typesafe.scalalogging.LazyLogging
import org.apache.nlpcraft.common.ascii.NCAsciiTable
-import org.apache.nlpcraft.common.util.NCUtils
+import org.apache.nlpcraft.common._
import org.apache.nlpcraft.model.tools.embedded.NCEmbeddedProbe
import org.apache.nlpcraft.model.tools.test.NCTestClientBuilder
import org.apache.nlpcraft.model._
import org.apache.nlpcraft.probe.mgrs.model.NCModelManager
+import org.apache.nlpcraft.common.ansi.NCAnsiColor._
/**
* Implementation for `NCTestAutoModelValidator` class.
@@ -33,7 +34,7 @@ private [test] object NCTestAutoModelValidatorImpl extends
LazyLogging {
@throws[Exception]
def isValid: Boolean =
- NCUtils.sysEnv(PROP_MODELS) match {
+ U.sysEnv(PROP_MODELS) match {
case Some(p) ⇒ isValid(getClasses(p.split(",")))
case None ⇒
logger.warn(s"System property '$PROP_MODELS' is not defined.")
@@ -114,7 +115,7 @@ private [test] object NCTestAutoModelValidatorImpl extends
LazyLogging {
tbl += (
res.modelId,
res.intentId,
- if (res.pass) "OK" else "FAIL",
+ if (res.pass) s"${ansiGreenFg}OK${ansiReset}" else
s"${ansiRedFg}FAIL${ansiReset}",
res.text,
res.error.getOrElse("")
)
@@ -125,7 +126,7 @@ private [test] object NCTestAutoModelValidatorImpl extends
LazyLogging {
if (failCnt > 0)
logger.error(s"Some model auto-validation failed - see details
below...")
- logger.info(s"\n\nModel auto-validation results: OK $passCnt, FAIL
$failCnt:\n${tbl.toString}")
+ logger.info(s"\n\nModel auto-validation results:
${ansiGreenFg}OK${ansiReset} $passCnt, ${ansiRedFg}FAIL${ansiReset}
$failCnt:\n${tbl.toString}")
failCnt == 0
}
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/conversation/NCConversation.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/conversation/NCConversation.scala
index bfdb299..a7d97cf 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/conversation/NCConversation.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/conversation/NCConversation.scala
@@ -226,7 +226,7 @@ case class NCConversation(
s"usrId=$usrId, " +
s"mdlId=$mdlId, " +
s"srvReqId=$srvReqId, " +
- s"groups=${grps.mkString("[", ", ",
"]")}, " +
+ s"groups=${grps.mkString(", ")}, " +
s"toks=${hs.map(_.token).mkString("[",
", ", "]")}" +
s"]"
)