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 2020/12/11 23:23:33 UTC
[incubator-nlpcraft] branch NLPCRAFT-170 updated: WIP +
NLPCRAFT-192.
This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-170
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-170 by this push:
new 558093f WIP + NLPCRAFT-192.
558093f is described below
commit 558093fd65d239bb91bf0cb5bff3419c2b523249
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Fri Dec 11 15:23:23 2020 -0800
WIP + NLPCRAFT-192.
---
.../org/apache/nlpcraft/model/NCIntentSample.java | 24 ++++++++++++++++++++++
.../nlpcraft/server/ignite/NCIgniteRunner.scala | 5 +++--
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSample.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSample.java
index 51d193f..6f48bb0 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSample.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSample.java
@@ -33,6 +33,30 @@ import static java.lang.annotation.RetentionPolicy.*;
* used by {@link NCTestAutoModelValidator} class from built-in test framework for auto-validation between
* data models and intents.
* <p>
+ * Here's an example of using this annotation (from <a target=_new href="https://nlpcraft.apache.org/examples/light_switch.html">LightSwitch</a> example):
+ * <pre class="brush: java, highlight: [2]">
+ * {@literal @}NCIntent("intent=act term(act)={groups {@literal @}{@literal @} 'act'} term(loc)={trim(id) == 'ls:loc'}*")
+ * {@literal @}NCIntentSample(Array(
+ * "Turn the lights off in the entire house.",
+ * "Switch on the illumination in the master bedroom closet.",
+ * "Get the lights on.",
+ * "Please, put the light out in the upstairs bedroom.",
+ * "Set the lights on in the entire house.",
+ * "Turn the lights off in the guest bedroom.",
+ * "Could you please switch off all the lights?",
+ * "Dial off illumination on the 2nd floor.",
+ * "Please, no lights!",
+ * "Kill off all the lights now!",
+ * "No lights in the bedroom, please."
+ * ))
+ * def onMatch(
+ * {@literal @}NCIntentTerm("act") actTok: NCToken,
+ * {@literal @}NCIntentTerm("loc") locToks: List[NCToken]
+ * ): NCResult = {
+ * ...
+ * }
+ * </pre>
+ * <p>
* Read full documentation in <a target=_ href="https://nlpcraft.apache.org/intent-matching.html">Intent Matching</a> section and review
* <a target=_ href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/">examples</a>.
*
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/ignite/NCIgniteRunner.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/ignite/NCIgniteRunner.scala
index e2b8304..cda069e 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/ignite/NCIgniteRunner.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/ignite/NCIgniteRunner.scala
@@ -18,10 +18,11 @@
package org.apache.nlpcraft.server.ignite
import com.typesafe.scalalogging.LazyLogging
+import org.apache.ignite.cluster.ClusterState
import org.apache.ignite.{IgniteException, Ignition}
import org.apache.nlpcraft.common._
-import java.io.File
+import java.io.File
import scala.sys.SystemProperties
/**
@@ -72,7 +73,7 @@ object NCIgniteRunner extends LazyLogging {
}
}
- ignite.cluster().active(true)
+ ignite.cluster().state(ClusterState.ACTIVE)
ignite
}