[incubator-nlpcraft] branch NLPCRAFT-27 updated: WIP.

2020-03-25 Thread sergeykamov
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/NLPCRAFT-27 by this push:
 new e63fd6b  WIP.
e63fd6b is described below

commit e63fd6b1efa81b04de26b07f240d33fae33ee9b1
Author: Sergey Kamov 
AuthorDate: Wed Mar 25 20:53:12 2020 +0300

WIP.
---
 src/main/scala/org/apache/nlpcraft/examples/phone/PhoneTest.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneTest.java 
b/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneTest.java
index 4806f34..959e628 100644
--- a/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneTest.java
+++ b/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneTest.java
@@ -23,6 +23,7 @@ import 
org.apache.nlpcraft.model.tools.test.NCTestClientBuilder;
 import org.apache.nlpcraft.probe.embedded.NCEmbeddedProbe;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
@@ -54,6 +55,8 @@ class PhoneTest {
 NCEmbeddedProbe.stop();
 }
 
+// Uncomment if this model is configured.
+@Disabled
 @Test
 void test() throws NCException, IOException {
 assertTrue(client.ask("Call to Apple office").isOk());



[incubator-nlpcraft] branch NLPCRAFT-27 updated: WIP.

2020-03-25 Thread sergeykamov
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/NLPCRAFT-27 by this push:
 new cbcc9b7  WIP.
cbcc9b7 is described below

commit cbcc9b7c43ed2edd632adb120832a8af94ceb543
Author: Sergey Kamov 
AuthorDate: Wed Mar 25 19:59:44 2020 +0300

WIP.
---
 .../common/nlp/core/NCNlpCoreManager.scala |  2 +-
 .../common/nlp/dict/NCDictionaryManager.scala  |  4 +--
 .../probe/mgrs/conn/NCConnectionManager.scala  | 40 +++--
 .../mgrs/conversation/NCConversationManager.scala  |  3 +-
 .../probe/mgrs/deploy/NCDeployManager.scala| 15 
 .../mgrs/dialogflow/NCDialogFlowManager.scala  |  5 +--
 .../probe/mgrs/lifecycle/NCLifecycleManager.scala  | 10 +++---
 .../nlpcraft/probe/mgrs/model/NCModelManager.scala |  4 ++-
 .../probe/mgrs/nlp/NCProbeEnrichmentManager.scala  | 12 ---
 .../mgrs/nlp/validate/NCValidateManager.scala  |  2 +-
 .../apache/nlpcraft/server/geo/NCGeoManager.scala  |  4 +--
 .../lifecycle/NCServerLifecycleManager.scala   |  4 +--
 .../lifecycle/opencensus/NCJaegerExporter.scala|  6 ++--
 .../opencensus/NCPrometheusExporter.scala  |  8 ++---
 .../opencensus/NCStackdriverStatsExporter.scala|  4 +--
 .../opencensus/NCStackdriverTraceExporter.scala|  2 +-
 .../lifecycle/opencensus/NCZipkinExporter.scala|  8 ++---
 .../server/nlp/core/NCNlpServerManager.scala   |  6 ++--
 .../server/nlp/core/spacy/NCSpaCyNerEnricher.scala |  2 +-
 .../nlp/core/stanford/NCStanfordCoreManager.scala  |  2 +-
 .../nlp/enrichers/NCServerEnrichmentManager.scala  |  2 +-
 .../server/nlp/enrichers/date/NCDateEnricher.scala |  2 +-
 .../nlpcraft/server/probe/NCProbeManager.scala | 41 ++
 .../nlpcraft/server/query/NCQueryManager.scala |  4 ++-
 .../nlpcraft/server/rest/NCRestManager.scala   |  6 ++--
 .../org/apache/nlpcraft/server/sql/NCSql.scala | 20 +--
 .../apache/nlpcraft/server/sql/NCSqlManager.scala  |  2 +-
 .../apache/nlpcraft/server/tx/NCTxManager.scala|  5 +--
 .../nlpcraft/server/user/NCUserManager.scala   | 10 +++---
 29 files changed, 131 insertions(+), 104 deletions(-)

diff --git 
a/src/main/scala/org/apache/nlpcraft/common/nlp/core/NCNlpCoreManager.scala 
b/src/main/scala/org/apache/nlpcraft/common/nlp/core/NCNlpCoreManager.scala
index 6dedbbd..d8e431c 100644
--- a/src/main/scala/org/apache/nlpcraft/common/nlp/core/NCNlpCoreManager.scala
+++ b/src/main/scala/org/apache/nlpcraft/common/nlp/core/NCNlpCoreManager.scala
@@ -29,7 +29,7 @@ object NCNlpCoreManager extends NCService {
 private final val SUPPORTED_NLP_ENGINES = Seq("opennlp", "stanford")
 
 private object Config extends NCConfigurable {
-val engine: String = getString("nlpcraft.nlpEngine")
+def engine: String = getString("nlpcraft.nlpEngine")
 }
 
 @volatile private var tokenizer: NCNlpTokenizer = _
diff --git 
a/src/main/scala/org/apache/nlpcraft/common/nlp/dict/NCDictionaryManager.scala 
b/src/main/scala/org/apache/nlpcraft/common/nlp/dict/NCDictionaryManager.scala
index c5bdcc7..9eafe87 100644
--- 
a/src/main/scala/org/apache/nlpcraft/common/nlp/dict/NCDictionaryManager.scala
+++ 
b/src/main/scala/org/apache/nlpcraft/common/nlp/dict/NCDictionaryManager.scala
@@ -40,8 +40,8 @@ object NCDictionaryManager extends NCService {
 require(NCDictionaryType.values.forall(dictFiles.contains))
 
 // Summary dictionary for all types.
-private var full: Set[String] = _
-private var dicts: Map[NCDictionaryType, Set[String]] = _
+@volatile private var full: Set[String] = _
+@volatile private var dicts: Map[NCDictionaryType, Set[String]] = _
 
 override def start(parent: Span): NCService = startScopedSpan("start", 
parent, "dictionaries" → dictFiles.values.mkString(",")) { _ ⇒
 dicts = dictFiles.map(p ⇒ {
diff --git 
a/src/main/scala/org/apache/nlpcraft/probe/mgrs/conn/NCConnectionManager.scala 
b/src/main/scala/org/apache/nlpcraft/probe/mgrs/conn/NCConnectionManager.scala
index b200b87..1094b16 100644
--- 
a/src/main/scala/org/apache/nlpcraft/probe/mgrs/conn/NCConnectionManager.scala
+++ 
b/src/main/scala/org/apache/nlpcraft/probe/mgrs/conn/NCConnectionManager.scala
@@ -49,30 +49,30 @@ object NCConnectionManager extends NCService {
 private final val PING_TIMEOUT = 5 * 1000
 
 // Internal probe GUID.
-final val PROBE_GUID = U.genGuid()
+@volatile private var probeGuid: String = _
 
 // Internal semaphores.
-private val stopSem: AtomicInteger = new AtomicInteger(1)
+@volatile private var stopSem: AtomicInteger = _
 
 private final val sysProps: Properties = System.getProperties
 private final val localHost: InetAddress = InetAddress.getLocalHost
-private var hwAddrs: String = _
+@volatile private var hwA

[incubator-nlpcraft] branch NLPCRAFT-27 updated: WIP.

2020-03-25 Thread sergeykamov
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/NLPCRAFT-27 by this push:
 new afc26f6  WIP.
afc26f6 is described below

commit afc26f6423720da1b1fc66c08e151c17bb5e3585
Author: Sergey Kamov 
AuthorDate: Wed Mar 25 16:45:37 2020 +0300

WIP.
---
 .../org/apache/nlpcraft/common/config/NCConfigurable.scala|  4 ++--
 .../apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala   | 11 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git 
a/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala 
b/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
index b0cb272..457bb0b 100644
--- a/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
+++ b/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
@@ -29,8 +29,8 @@ import scala.collection.JavaConverters._
 trait NCConfigurable extends LazyLogging {
 import NCConfigurable._
 
-// Accessor to the loaded config.
-private val hocon: Config = cfg
+// Accessor to the loaded config. It should reload config.
+private def hocon: Config = cfg
 
 /**
   *
diff --git 
a/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala 
b/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
index 050879a..e496a92 100644
--- a/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
+++ b/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
@@ -46,11 +46,12 @@ object NCDeployManager extends NCService with 
DecorateAsScala {
 
 private object Config extends NCConfigurable {
 private final val pre = "nlpcraft.probe"
-
-val modelFactoryType: Option[String] = 
getStringOpt(s"$pre.modelFactory.type")
-val modelFactoryProps: Option[Map[String, String]] = 
getMapOpt(s"$pre.modelFactory.properties")
-val models: Seq[String] = getStringList(s"$pre.models")
-val jarsFolder: Option[String] = getStringOpt(s"$pre.jarsFolder")
+
+// It should reload config.
+def modelFactoryType: Option[String] = 
getStringOpt(s"$pre.modelFactory.type")
+def modelFactoryProps: Option[Map[String, String]] = 
getMapOpt(s"$pre.modelFactory.properties")
+def models: Seq[String] = getStringList(s"$pre.models")
+def jarsFolder: Option[String] = getStringOpt(s"$pre.jarsFolder")
 }
 
 /**