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/06/15 21:51:03 UTC

[incubator-nlpcraft] branch NLPCRAFT-80 updated: Renaming.

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

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


The following commit(s) were added to refs/heads/NLPCRAFT-80 by this push:
     new 9c56593  Renaming.
9c56593 is described below

commit 9c56593b2794c8cdd7de87edf32a29ac562d43b6
Author: Aaron Radzinzski <ar...@datalingvo.com>
AuthorDate: Mon Jun 15 14:50:37 2020 -0700

    Renaming.
---
 .../scala/org/apache/nlpcraft/examples/alarm/AlarmModel.java     | 2 +-
 .../apache/nlpcraft/examples/lightswitch/LightSwitchModel.scala  | 2 +-
 .../scala/org/apache/nlpcraft/examples/phone/PhoneModel.java     | 2 +-
 .../main/scala/org/apache/nlpcraft/examples/sql/SqlModel.scala   | 4 ++--
 .../main/scala/org/apache/nlpcraft/examples/time/TimeModel.java  | 4 ++--
 .../scala/org/apache/nlpcraft/examples/weather/WeatherModel.java | 6 +++---
 nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntent.java  | 2 +-
 .../src/main/scala/org/apache/nlpcraft/model/NCIntentRef.java    | 2 +-
 .../nlpcraft/model/{NCIntentExample.java => NCIntentSample.java} | 9 +++++----
 .../src/main/scala/org/apache/nlpcraft/model/NCIntentTerm.java   | 2 +-
 10 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/alarm/AlarmModel.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/alarm/AlarmModel.java
index 2eb26a4..5cff05b 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/alarm/AlarmModel.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/alarm/AlarmModel.java
@@ -54,7 +54,7 @@ public class AlarmModel extends NCModelFileAdapter {
      * @return Query result.
      */
     @NCIntentRef("alarm")
-    @NCIntentExample({
+    @NCIntentSample({
         "Ping me in 3 minutes",
         "Buzz me in an hour and 15mins",
         "Set my alarm for 30s"
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModel.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModel.scala
index 8cd5512..5ba37ce 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModel.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModel.scala
@@ -40,7 +40,7 @@ class LightSwitchModel extends NCModelFileAdapter("org/apache/nlpcraft/examples/
       * @return Query result to be sent to the REST caller.
       */
     @NCIntentRef("ls")
-    @NCIntentExample(Array(
+    @NCIntentSample(Array(
         "Turn the lights off in the entire house.",
         "Switch on the illumination in the master bedroom closet.",
         "Get the lights on.",
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneModel.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneModel.java
index 1aad7c0..2910ed5 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneModel.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneModel.java
@@ -58,7 +58,7 @@ public class PhoneModel extends NCModelFileAdapter {
         // Either organization, person or a phone number (or a combination of).
         "term(rcpt)={id == 'google:organization' || id == 'google:person' || id == 'google:phone_number'}[1,3]"
     )
-    @NCIntentExample({
+    @NCIntentSample({
         "Call to Apple office",
         "Can you please ping John Smith?",
         "Could you dial +7 (931) 188 34 58 and ask Mike?"
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/SqlModel.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/SqlModel.scala
index e4fb86c..761fe71 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/SqlModel.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/SqlModel.scala
@@ -287,7 +287,7 @@ class SqlModel extends NCModelFileAdapter("org/apache/nlpcraft/examples/sql/sql_
         "term(sort)={id == 'nlpcraft:sort'}? " +
         "term(limit)={id == 'nlpcraft:limit'}?"
     )
-    @NCIntentExample(Array(
+    @NCIntentSample(Array(
         "order date, please!",
         "show me the order dates",
         "list dates of orders"
@@ -349,7 +349,7 @@ class SqlModel extends NCModelFileAdapter("org/apache/nlpcraft/examples/sql/sql_
         "term(condFreeDate)={id == 'nlpcraft:date'}? " +
         "term(limit)={id == 'nlpcraft:limit'}?"
     )
-    @NCIntentExample(Array(
+    @NCIntentSample(Array(
         "What are the least performing categories for the last quarter?"
     ))
     def onCustomSortReport(
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/time/TimeModel.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/time/TimeModel.java
index 872640f..646a18a 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/time/TimeModel.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/time/TimeModel.java
@@ -95,7 +95,7 @@ public class TimeModel extends NCModelFileAdapter {
      * @return Query result.
      */
     @NCIntent("intent=intent1 conv=false term={id=='x:time'}")
-    @NCIntentExample({
+    @NCIntentSample({
         "What's the local time?"
     })
     private NCResult onLocalMatch(NCIntentMatch ctx) {
@@ -129,7 +129,7 @@ public class TimeModel extends NCModelFileAdapter {
      * @return Query result.
      */
     @NCIntent("intent=intent2 term={id=='x:time'} term(city)={id=='nlpcraft:city'}")
-    @NCIntentExample({
+    @NCIntentSample({
         "What time is it now in New York City?",
         "What's the current time in Moscow?",
         "Show me time of the day in London.",
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java
index 86657c0..5a227fc 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java
@@ -221,7 +221,7 @@ public class WeatherModel extends NCModelFileAdapter {
      * @return Query result.
      */
     @NCIntent("intent=fcast term={id == 'wt:fcast'} term(city)={id == 'nlpcraft:city'}? term(date)={id == 'nlpcraft:date'}?")
-    @NCIntentExample({
+    @NCIntentSample({
         "What's the weather forecast in Moscow?"
     })
     public NCResult onForecastMatch(
@@ -239,7 +239,7 @@ public class WeatherModel extends NCModelFileAdapter {
      * @return Query result.
      */
     @NCIntent("intent=hist term={id == 'wt:hist'} term(city)={id == 'nlpcraft:city'}? term(date)={id == 'nlpcraft:date'}?")
-    @NCIntentExample({
+    @NCIntentSample({
         "What was the weather history in Moscow?"
     })
     public NCResult onHistoryMatch(
@@ -257,7 +257,7 @@ public class WeatherModel extends NCModelFileAdapter {
      * @return Query result.
      */
     @NCIntent("intent=curr term={id == 'wt:curr'} term(city)={id == 'nlpcraft:city'}? term(date)={id == 'nlpcraft:date'}?")
-    @NCIntentExample({
+    @NCIntentSample({
         "What's the current weather in Moscow"
     })
     public NCResult onCurrentMatch(
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntent.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntent.java
index c5523c7..a984275 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntent.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntent.java
@@ -31,7 +31,7 @@ import static java.lang.annotation.RetentionPolicy.*;
  *
  * @see NCIntentRef
  * @see NCIntentTerm
- * @see NCIntentExample
+ * @see NCIntentSample
  * @see NCIntentSkip
  * @see NCIntentMatch
  * @see NCModel#onMatchedIntent(NCIntentMatch) 
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentRef.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentRef.java
index 6606c3e..0ffd06c 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentRef.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentRef.java
@@ -32,7 +32,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
  *
  * @see NCIntent
  * @see NCIntentTerm
- * @see NCIntentExample
+ * @see NCIntentSample
  * @see NCIntentSkip
  * @see NCIntentMatch
  * @see NCModel#onMatchedIntent(NCIntentMatch)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentExample.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSample.java
similarity index 83%
rename from nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentExample.java
rename to nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSample.java
index 4c2f149..3781bf0 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentExample.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSample.java
@@ -23,12 +23,12 @@ import static java.lang.annotation.ElementType.*;
 import static java.lang.annotation.RetentionPolicy.*;
 
 /**
- * Annotation to define one or more examples of the user input that should match a corresponding intent. This
+ * Annotation to define one or more samples of the user input that should match a corresponding intent. This
  * annotation can only be used together with {@link NCIntent} or {@link NCIntentRef} annotations on the callback
  * methods. Method can have multiple annotations of this type and each annotation can define multiple input
  * examples.
  * <p>
- * Note that the examples provided by this annotation not only serve the documentation purpose but are also
+ * Note that the samples provided by this annotation not only serve the documentation purpose but are also
  * used internally by various parts of NLPCraft for uint testing, synonym detection, etc. It is highly
  * advisable to provide multiple examples (the more the better) per each intent through this annotation.
  * <p>
@@ -45,9 +45,10 @@ import static java.lang.annotation.RetentionPolicy.*;
 @Documented
 @Retention(value=RUNTIME)
 @Target(value=METHOD)
-public @interface NCIntentExample {
+public @interface NCIntentSample {
     /**
-     * Gets set of user input examples that should match corresponding intent.
+     * Gets a list of user input samples that should match corresponding intent. This annotation should be
+     * attached the intent callback method.
      *
      * @return Set of user input examples that should match corresponding intent.
      */
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentTerm.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentTerm.java
index 68a5d95..85fbad1 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentTerm.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentTerm.java
@@ -35,7 +35,7 @@ import static java.lang.annotation.RetentionPolicy.*;
  *
  * @see NCIntent
  * @see NCIntentRef
- * @see NCIntentExample
+ * @see NCIntentSample
  * @see NCIntentSkip
  * @see NCIntentMatch
  * @see NCModel#onMatchedIntent(NCIntentMatch)