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/02 02:47:06 UTC

[incubator-nlpcraft-website] branch web-site updated: Doc fixes.

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

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


The following commit(s) were added to refs/heads/web-site by this push:
     new 8d8cfbe  Doc fixes.
8d8cfbe is described below

commit 8d8cfbe447d54b6e8eb5766b7d890fc77dfa39b2
Author: Aaron Radzinzski <ar...@datalingvo.com>
AuthorDate: Mon Jun 1 19:46:01 2020 -0700

    Doc fixes.
---
 basic-concepts.html        |   2 +-
 data-model.html            |   2 +-
 docs.html                  |   2 +-
 examples/alarm_clock.html  |  37 +++++---
 examples/light_switch.html |  32 +++++--
 examples/weather_bot.html  | 224 ++++++++++++++++++++++++++++++++++++++++++++-
 feed.xml                   |   2 +-
 first-example.html         |   4 +-
 getting-started.html       |   2 +-
 installation.html          |   2 +-
 integrations.html          |   2 +-
 intent-matching.html       |   2 +-
 metrics-and-tracing.html   |   2 +-
 server-and-probe.html      |   2 +-
 tools/embedded_probe.html  |   2 +-
 tools/sql_model_gen.html   |   2 +-
 tools/test_framework.html  |   2 +-
 using-rest.html            |   2 +-
 18 files changed, 286 insertions(+), 39 deletions(-)

diff --git a/basic-concepts.html b/basic-concepts.html
index ca5219b..1046b30 100644
--- a/basic-concepts.html
+++ b/basic-concepts.html
@@ -15,4 +15,4 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
diff --git a/data-model.html b/data-model.html
index 4c46982..0bac7ce 100644
--- a/data-model.html
+++ b/data-model.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
 {
      "id": "user.defined.id",
      "name": "User Defined Name",
diff --git a/docs.html b/docs.html
index 686e05b..a7d8d9f 100644
--- a/docs.html
+++ b/docs.html
@@ -15,4 +15,4 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
diff --git a/examples/alarm_clock.html b/examples/alarm_clock.html
index cdc7a6d..5ab76cb 100644
--- a/examples/alarm_clock.html
+++ b/examples/alarm_clock.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
             mvn archetype:generate -DgroupId=examples -DartifactId=my-app -DarchetypeVersion=1.4 -DinteractiveMode=false
         </pre><p> This will create <code>my-app</code> folder with the following default maven project structure:</p><pre class="console">
 ├── <b>pom.xml</b>
@@ -42,7 +42,7 @@
                 &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
                 &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
             &lt;/properties&gt;
-        </pre><p> IDEA should automatically reload the project with newly updated <code>pom.xml</code> file and we should be ready now to develop our data model.</p></section><section id="model"><h3 class="section-title">Data Model</h3><p> We are going to start with declaring our semantic model using JSON. Create new <code>alarm_model.json</code> file and add the following model declaration into it:</p><pre class="brush: js, highlight: [7, 16, 25]">
+        </pre><p> IDEA should automatically reload the project with newly updated <code>pom.xml</code> file and we should be ready now to develop our data model.</p></section><section id="model"><h3 class="section-title">Data Model</h3><p> We are going to start with declaring the static part of our semantic model using JSON which we will later load using <code>NCModelFileAdapter</code> in our Java-based model implementation. Create new <code>alarm_model.json</code> file and add the follo [...]
 {
     "id": "nlpcraft.alarm.ex",
     "name": "Alarm Example Model",
@@ -154,28 +154,39 @@ public class AlarmModel extends NCModelFileAdapter {
         return NCResult.text("Timer set for: " + FMT.format(dt));
     }
 }
-        </pre><p> There's a bit of a logic here that deals mostly with taking multiple numeric values and converting them into a single number of milliseconds that the alarm clock needs to be set up for. Let's review it step by step:</p><ul><li> On <code>line 1</code> our class extends <code>NCModelFileAdapter</code> that allows us to load most of the model declaration from the external JSON or YAML file (<code>line 10</code>) and only provide functionality that we couldn't express in de [...]
-import org.junit.jupiter.api.*;
+        </pre><p> There's a bit of a logic here that deals mostly with taking multiple numeric values and converting them into a single number of milliseconds that the alarm clock needs to be set up for. Let's review it step by step:</p><ul><li> On line 9 our class extends <code>NCModelFileAdapter</code> that allows us to load most of the model declaration from the external JSON or YAML file (line 18) and only provide functionality that we couldn't express in declarative portion in JSON. [...]
+package org.apache.nlpcraft.examples.alarm;
+
 import org.apache.nlpcraft.common.NCException;
-import org.apache.nlpcraft.model.tools.test.*;
+import org.apache.nlpcraft.model.tools.test.NCTestClient;
+import org.apache.nlpcraft.model.tools.test.NCTestClientBuilder;
+import org.apache.nlpcraft.probe.embedded.NCEmbeddedProbe;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 class AlarmTest {
-    private NCTestClient cli;
+    static private NCTestClient cli;
+
+    @BeforeAll
+    static void setUp() throws NCException, IOException {
+        NCEmbeddedProbe.start(AlarmModel.class);
 
-    @BeforeEach
-    void setUp() throws NCException, IOException {
         cli = new NCTestClientBuilder().newBuilder().build();
 
         cli.open("nlpcraft.alarm.ex"); // See alarm_model.json
     }
 
-    @AfterEach
-    void tearDown() throws NCException, IOException {
-        cli.close();
+    @AfterAll
+    static void tearDown() throws NCException, IOException {
+        if (cli != null)
+            cli.close();
+
+        NCEmbeddedProbe.stop();
     }
 
     @Test
@@ -184,4 +195,6 @@ class AlarmTest {
         assertTrue(cli.ask("Buzz me in an hour and 15mins").isOk());
         assertTrue(cli.ask("Set my alarm for 30s").isOk());
     }
-}        </pre><p> This test is pretty straight forward:</p><ul><li> On <code>line 16</code> we open the test client with the model ID (see <code>alarm_model.json</code> file for where we declared it).<li> <code>Line 26, 27, and 28</code> is where we issue our test sentences and we should see the confirmation messages and eventually "BEEP BEEP BEEP" print outs in the data probe console.</ul><p> Right click on this class in the project view and run it. You should be getting standard outpu [...]
+}
+
+        </pre><p> This test is pretty straight forward:</p><ul><li> On line 24 we open the test client with the model ID (see <code>alarm_model.json</code> file for where we declared it).<li> Line 37, 38, and 39 is where we issue our test sentences and we should see the confirmation messages and eventually "BEEP BEEP BEEP" print outs in the data probe console.</ul><div class="bq info"><p><b>Embedded Prove</b></p><p> This test uses <a href="/tools/embedded_probe.html">embedded probe</a> w [...]
diff --git a/examples/light_switch.html b/examples/light_switch.html
index 2576508..1b5f4c6 100644
--- a/examples/light_switch.html
+++ b/examples/light_switch.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
             mvn archetype:generate -DgroupId=examples -DartifactId=my-app -DarchetypeVersion=1.4 -DinteractiveMode=false
         </pre><p> This will create <code>my-app</code> folder with the following default maven project structure:</p><pre class="console">
 ├── <b>pom.xml</b>
@@ -42,7 +42,7 @@
                 &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
                 &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
             &lt;/properties&gt;
-        </pre><p> IDEA should automatically reload the project with newly updated <code>pom.xml</code> file and we should be ready now to develop our data model.</p></section><section id="model"><h3 class="section-title">Data Model</h3><p> We are going to start with declaring our semantic model using YAML. Create new <code>lightswitch_model.yaml</code> file and add the following model declaration into it:</p><pre class="brush: js, highlight: [10, 19, 26, 34, 42]">
+        </pre><p> IDEA should automatically reload the project with newly updated <code>pom.xml</code> file and we should be ready now to develop our data model.</p></section><section id="model"><h3 class="section-title">Data Model</h3><p> We are going to start with declaring the static part of our semantic model using YAML which we will later load using <code>NCModelFileAdapter</code> in our Sccla-based model implementation. Create new <code>lightswitch_model.yaml</code> file and add th [...]
 id: "nlpcraft.lightswitch.ex"
 name: "Light Switch Example Model"
 version: "1.0"
@@ -109,19 +109,28 @@ class LightSwitchModel extends NCModelFileAdapter("org/apache/nlpcraft/examples/
         NCResult.text(s"Lights '$status' in '${locations.toLowerCase}'.")
     }
 }
-        </pre><p> The intent callback logic is very simple - we simply return a descriptive confirmation message back (explaining what lights were changed). With action and location detected - you can easily add the actual light switching using HomeKit or Arduino devices. Let's review this implementation step by step:</p><ul><li> On <code>line 4</code> our class extends <code>NCModelFileAdapter</code> that allows us to load most of the model declaration from the external YAML file and on [...]
-import org.junit.jupiter.api.*;
-import org.apache.nlpcraft.common.*;
-import org.apache.nlpcraft.model.tools.test.*;
-import java.io.*;
+        </pre><p> The intent callback logic is very simple - we simply return a descriptive confirmation message back (explaining what lights were changed). With action and location detected - you can easily add the actual light switching using HomeKit or Arduino devices. Let's review this implementation step by step:</p><ul><li> On <code>line 4</code> our class extends <code>NCModelFileAdapter</code> that allows us to load most of the model declaration from the external YAML file and on [...]
+package org.apache.nlpcraft.examples.lightswitch;
 
-import static org.junit.jupiter.api.Assertions.*;
+import org.apache.nlpcraft.common.NCException;
+import org.apache.nlpcraft.model.tools.test.NCTestClient;
+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.Test;
+
+import java.io.IOException;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 class LightSwitchTest {
     private NCTestClient cli;
 
     @BeforeEach
     void setUp() throws NCException, IOException {
+        NCEmbeddedProbe.start(LightSwitchModel.class);
+
         cli = new NCTestClientBuilder().newBuilder().build();
 
         cli.open("nlpcraft.lightswitch.ex");
@@ -129,7 +138,10 @@ class LightSwitchTest {
 
     @AfterEach
     void tearDown() throws NCException, IOException {
-        cli.close();
+        if (cli != null)
+            cli.close();
+
+        NCEmbeddedProbe.stop();
     }
 
     @Test
@@ -147,4 +159,4 @@ class LightSwitchTest {
         assertTrue(cli.ask("No lights in the bedroom, please.").isOk());
     }
 }
-        </pre><p> This test is pretty straight forward:</p><ul><li> On <code>line 15</code> we open the test client with the model ID (see <code>lightswitch_model.yaml</code> file for where we declared it).<li> Test on <code>line 24</code> is where we issue our test sentences and we should see the confirmation messages in our test console output.</ul><p> Right click on this class in the project view and run it. You should be getting standard output in JUnit panel as well as the output in [...]
+        </pre><p> This test is pretty straight forward:</p><ul><li> On <code>line 24</code> we open the test client with the model ID (see <code>lightswitch_model.yaml</code> file for where we declared it).<li> Test on <code>line 36</code> is where we issue our test sentences and we should see the confirmation messages in our test console output.</ul><div class="bq info"><p><b>Embedded Prove</b></p><p> This test uses <a href="/tools/embedded_probe.html">embedded probe</a> which automatic [...]
diff --git a/examples/weather_bot.html b/examples/weather_bot.html
index 599e729..0bb01d3 100644
--- a/examples/weather_bot.html
+++ b/examples/weather_bot.html
@@ -15,4 +15,226 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+            mvn archetype:generate -DgroupId=examples -DartifactId=my-app -DarchetypeVersion=1.4 -DinteractiveMode=false
+        </pre><p> This will create <code>my-app</code> folder with the following default maven project structure:</p><pre class="console">
+├── <b>pom.xml</b>
+└── src
+    ├── main
+    │   └── java
+    │       └── examples
+    │           └── App.java
+    └── test
+        └── java
+            └── examples
+                └── AppTest.java
+        </pre><div class="bq info"><p> Note that this setup is same for all examples. Note also that you can use any other tools for creating and managing Java project with or without Maven.</p></div><p> For our example we'll use JetBrain's <a target=_new href="https://www.jetbrains.com/idea/">IntelliJ IDEA</a>. Create new IDEA project from this source folder (make sure to pick JDK 8 or later JDK and language support). Let's also delete auto-generated files <code>App.java</code> and <cod [...]
+            &lt;dependencies&gt;
+                &lt;dependency&gt;
+                    &lt;groupId&gt;org.apache.nlpcraft&lt;/groupId&gt;
+                    &lt;artifactId&gt;nlpcraft&lt;/artifactId&gt;
+                    &lt;version&gt;0.5.0&lt;/version&gt;
+                &lt;/dependency&gt;
+            &lt;/dependencies&gt;
+        </pre><p> Also make sure that you have correct JDK version (1.8 or above) for the maven compiler plugin:</p><pre class="brush: xml, highlight: [3, 4]">
+            &lt;properties&gt;
+                &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
+                &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
+                &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
+            &lt;/properties&gt;
+        </pre><p> IDEA should automatically reload the project with newly updated <code>pom.xml</code> file and we should be ready now to develop our data model.</p></section><section id="model"><h3 class="section-title">Data Model</h3><p> We are going to start with declaring the static part of our semantic model using JSON which we will later load using <code>NCModelFileAdapter</code> in our Java-based model implementation. Create new <code>weather_model.json</code> file and add the fol [...]
+{
+    "id": "nlpcraft.weather.ex",
+    "name": "Weather Example Model",
+    "version": "1.0",
+    "description": "Weather example model.",
+    "examples": [
+        "What's the local weather forecast?",
+        "What's the weather in Moscow?"
+    ],
+    "macros": [
+        {
+            "name": "&lt;OF&gt;",
+            "macro": "{of|for|per}"
+        },
+        {
+            "name": "&lt;CHANCE&gt;",
+            "macro": "{chance|possibility|probability|odds|likelihood|potential|risk|opportunity}"
+        },
+        {
+            "name": "&lt;PHENOMENON&gt;",
+            "macro": "{high sea|severe weather|hail|heat wave|cold wave|derecho|supercell|avalanche|cyclone|wildfire|landslide|firestorm|dust storm|thunder snow|winter storm|cloudburst|shower|condensation|precipitation|drizzle|rainstorm|rain storm|rainfall|rain|storm|sun|sunshine|cloud|hot|cold|dry|wet|wind||hurricane|typhoon|sand-storm|sand storm|tornado|humid|fog|snow|smog|black ice|haze|thundershower|thundersnow|sleet|drought|wildfire|blizzard|avalanche|mist|thunderstorm}"
+        },
+        {
+            "name": "&lt;CUR&gt;",
+            "macro": "{current|present|moment|now}"
+        },
+        {
+            "name": "&lt;WEATHER&gt;",
+            "macro": "{weather {condition|temp|temperature|data|*}|condition|temp|temperature}"
+        },
+        {
+            "name": "&lt;FORECAST&gt;",
+            "macro": "{forecast|prognosis|prediction}"
+        },
+        {
+            "name": "&lt;HISTORY&gt;",
+            "macro": "{history|past}"
+        }
+    ],
+    "elements": [
+        {
+            "id": "wt:hist",
+            "description": "Past weather conditions.",
+            "synonyms": [
+                "{&lt;WEATHER&gt;|*} &lt;HISTORY&gt;",
+                "&lt;HISTORY&gt; {&lt;OF&gt;|*} {&lt;WEATHER&gt;|&lt;PHENOMENON&gt;}"
+            ]
+        },
+        {
+            "id": "wt:curr",
+            "description": "Current weather conditions.",
+            "synonyms": [
+                "{&lt;CUR&gt;|*} {&lt;WEATHER&gt;|&lt;PHENOMENON&gt;}",
+                "&lt;CHANCE&gt; &lt;OF&gt; &lt;PHENOMENON&gt;",
+                "&lt;PHENOMENON&gt; {&lt;CHANCE&gt;|*}"
+            ]
+        },
+        {
+            "id": "wt:fcast",
+            "description": "Future weather forecast.",
+            "synonyms": [
+                "{&lt;PHENOMENON&gt;|&lt;WEATHER&gt;|*} &lt;FORECAST&gt;",
+                "&lt;FORECAST&gt; {&lt;OF&gt;|*} {&lt;WEATHER&gt;|&lt;PHENOMENON&gt;}"
+            ]
+        }
+    ]
+}
+        </pre><p>There are number of important points here:</p><ul><li> <code>Line 10</code> defines several macros that are used later on throughout the model's elements to shorten the synonym declarations. Note how macros coupled with option groups shorten overall synonym declarations 1000:1 vs. manually listing all possible word permutations.<li> <code>Lines 42, 50, 59</code> define three model elements: the past, present and future (forecast) weather condition.</ul><p> Now that our m [...]
+    @NCIntent("intent=fcast term={id == 'wt:fcast'} term(city)={id == 'nlpcraft:city'}? term(date)={id == 'nlpcraft:date'}?")
+    public NCResult onForecastMatch(
+        NCIntentMatch ctx,
+        @NCIntentTerm("city") Optional&lt;NCToken&gt; cityTokOpt,
+        @NCIntentTerm("date") Optional&lt;NCToken&gt; dateTokOpt
+    ) {
+        return onPeriodMatch(ctx, cityTokOpt, dateTokOpt, 5);
+    }
+                
+    @NCIntent("intent=hist term={id == 'wt:hist'} term(city)={id == 'nlpcraft:city'}? term(date)={id == 'nlpcraft:date'}?")
+    public NCResult onHistoryMatch(
+        NCIntentMatch ctx,
+        @NCIntentTerm("city") Optional&lt;NCToken&gt; cityTokOpt,
+        @NCIntentTerm("date") Optional&lt;NCToken&gt; dateTokOpt
+    ) {
+        return onPeriodMatch(ctx, cityTokOpt, dateTokOpt, -5);
+    }
+                        
+    @NCIntent("intent=curr term={id == 'wt:curr'} term(city)={id == 'nlpcraft:city'}? term(date)={id == 'nlpcraft:date'}?")
+    public NCResult onCurrentMatch(
+        NCIntentMatch ctx,
+        @NCIntentTerm("city") Optional&lt;NCToken&gt; cityTokOpt,
+        @NCIntentTerm("date") Optional&lt;NCToken&gt; dateTokOpt
+    ) {
+        checkMatch(ctx);
+
+        try {
+            Coordinate cr = prepGeo(ctx, cityTokOpt);
+
+            if (dateTokOpt.isPresent()) {
+                DateRange range = extractDate(dateTokOpt.get());
+
+                return makeResult(srv.getTimeMachine(cr.latitude, cr.longitude, range.from, range.to), ctx.getIntentId());
+            }
+
+            return makeResult(srv.getCurrent(cr.latitude, cr.longitude), ctx.getIntentId());
+        }
+        catch (DarkSkyException e) {
+            throw new NCRejection(e.getLocalizedMessage());
+        }
+        catch (NCRejection e) {
+            throw e;
+        }
+        catch (Exception e) {
+            throw new NCRejection("Weather provider error.", e);
+        }
+    }
+        </pre><p> There three methods define three intents. Each intent is defined "in place", i.e. as an annotation on the method that acts as a callback for that intent:</p><ul><li> Line 1 defines intent and the callback for the weather forecast (weather in the future):<ul><li>Intent is ordered (default), supports conversation (default) and has ID <code>fcast</code><li>Intent has one mandatory term and two optional terms:<ul><li> Mandatory term is defined as a token with ID <code>wt:fc [...]
+package org.apache.nlpcraft.examples.weather;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import org.apache.nlpcraft.common.NCException;
+import org.apache.nlpcraft.model.tools.test.NCTestClient;
+import org.apache.nlpcraft.model.tools.test.NCTestClientBuilder;
+import org.apache.nlpcraft.model.tools.test.NCTestResult;
+import org.apache.nlpcraft.probe.embedded.NCEmbeddedProbe;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+class WeatherTest {
+    private static final Gson GSON = new Gson();
+    private static final Type TYPE_MAP_RESP = new TypeToken&lt;HashMap&lt;String, Object&gt;&gt;() {}.getType();
+    private NCTestClient cli;
+            
+    private void checkIntent(String txt, String intentId, boolean shouldBeSame) throws NCException, IOException {
+        NCTestResult res = cli.ask(txt);
+
+        assertTrue(res.isOk(), () -&gt; res.getResultError().get());
+
+        assert res.getResult().isPresent();
+
+        Map&lt;String, Object&gt; map = GSON.fromJson(res.getResult().get(), TYPE_MAP_RESP);
+
+        if (shouldBeSame)
+            assertEquals(intentId, map.get("intentId"));
+        else
+            assertNotEquals(intentId, map.get("intentId"));
+    }
+
+    @BeforeEach
+    void setUp() throws NCException, IOException {
+        NCEmbeddedProbe.start(WeatherModel.class);
+
+        cli = new NCTestClientBuilder().newBuilder().build();
+
+        cli.open("nlpcraft.weather.ex");  // See weather_model.json
+    }
+
+    @AfterEach
+    void tearDown() throws NCException, IOException {
+        if (cli != null)
+            cli.close();
+
+        NCEmbeddedProbe.stop();
+    }
+
+    @Test
+    void test() throws NCException, IOException {
+        // Empty parameter.
+        assertTrue(cli.ask("").isFailed());
+
+        // Only latin charset is supported.
+        assertTrue(cli.ask("El tiempo en España").isFailed());
+
+        // Should be passed.
+        checkIntent("What's the local weather forecast?", "fcast", true);
+        checkIntent("What's the weather in Moscow?", "curr", true);
+        // Can be answered with conversation.
+        checkIntent("Chance of snow?", "curr", true);
+        checkIntent("Moscow", "curr", true);
+
+        cli.clearConversation();
+
+        // Cannot be answered without conversation.
+        assertTrue(cli.ask("Moscow").isFailed());
+    }
+}
+        </pre><p> This test is pretty straight forward:</p><ul><li> On line 47 we open the test client with the model ID (see <code>weather_model.yaml</code> file for where we declared it).<li> Test on line 59 is where we issue our test sentences and we should see the confirmation messages in our test console output.</ul><div class="bq info"><p><b>Embedded Prove</b></p><p> This test uses <a href="/tools/embedded_probe.html">embedded probe</a> which automatically start and stops the data  [...]
diff --git a/feed.xml b/feed.xml
index 650c867..69c21e7 100644
--- a/feed.xml
+++ b/feed.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2020-05-28T19:04:10-07:00</updated><id>http://localhost:4000/feed.xml</id><title type="html">Apache NLPCraft</title></feed>
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2020-06-01T19:42:49-07:00</updated><id>http://localhost:4000/feed.xml</id><title type="html">Apache NLPCraft</title></feed>
\ No newline at end of file
diff --git a/first-example.html b/first-example.html
index 97a5e6c..384546a 100644
--- a/first-example.html
+++ b/first-example.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
             mvn archetype:generate -DgroupId=examples -DartifactId=my-app -DarchetypeVersion=1.4 -DinteractiveMode=false
         </pre><p> This will create <code>my-app</code> folder with the following default maven project structure:</p><pre class="console">
 ├── <b>pom.xml</b>
@@ -101,7 +101,7 @@ class LightSwitchModel extends NCModelFileAdapter("org/apache/nlpcraft/examples/
         NCResult.text(s"Lights '$status' in '${locations.toLowerCase}'.")
     }
 }
-        </pre><p> Chapter <a href="/data-model.html">Data Model</a> will provide detailed explanation on how data models work. Here are few comments as to what this code does and how it is organized:</p><ul><li> On line 6 we use <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCModelFileAdapter.html">NCModelFileAdapter</a> adapter and load model static configuration from <code>lightswitch_model.yml</code> file.<li> Our data model uses intent-based matching of the user in [...]
+        </pre><p> Chapter <a href="/data-model.html">Data Model</a> will provide detailed explanation on how data models work. Here are few comments as to what this code does and how it is organized:</p><ul><li> On line 6 we use <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCModelFileAdapter.html">NCModelFileAdapter</a> adapter and load model static configuration from <code>lightswitch_model.yml</code> file.<li> Our data model uses intent-based matching of the user in [...]
 package examples;
 
 import org.junit.jupiter.api.*;
diff --git a/getting-started.html b/getting-started.html
index 73fe742..60a1570 100644
--- a/getting-started.html
+++ b/getting-started.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
                     $ cd build
                     $ java -jar apache-nlpcraft-0.5.0-all-deps.jar -server
                 </pre><p> You can can also start it via Docker:</p><pre class="brush: plain">
diff --git a/installation.html b/installation.html
index da616d6..342a8b2 100644
--- a/installation.html
+++ b/installation.html
@@ -15,4 +15,4 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
diff --git a/integrations.html b/integrations.html
index e06faeb..634ffcf 100644
--- a/integrations.html
+++ b/integrations.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
                     &lt;dependency&gt;
                         &lt;groupId&gt;edu.stanford.nlp&lt;/groupId&gt;
                         &lt;artifactId&gt;stanford-corenlp&lt;/artifactId&gt;
diff --git a/intent-matching.html b/intent-matching.html
index 35f42c0..3dbff0c 100644
--- a/intent-matching.html
+++ b/intent-matching.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
             &#64;NCIntent("intent=act conv=false term(act)={groups @@ 'act'} term(loc)={trim(id) == 'ls:loc'}*")
             def onMatch(
                 &#64;NCIntentTerm("act") actTok: NCToken,
diff --git a/metrics-and-tracing.html b/metrics-and-tracing.html
index bc1da0d..054a655 100644
--- a/metrics-and-tracing.html
+++ b/metrics-and-tracing.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
 nlpcraft {
     server {
         ...
diff --git a/server-and-probe.html b/server-and-probe.html
index 43cdf06..b985648 100644
--- a/server-and-probe.html
+++ b/server-and-probe.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
 ├── LICENSE
 ├── bin
 ├── sql
diff --git a/tools/embedded_probe.html b/tools/embedded_probe.html
index f50afe4..47eb35d 100644
--- a/tools/embedded_probe.html
+++ b/tools/embedded_probe.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
 public class AlarmTest {
     private NCTestClient cli;
 
diff --git a/tools/sql_model_gen.html b/tools/sql_model_gen.html
index 0ce8c5b..4b6c661 100644
--- a/tools/sql_model_gen.html
+++ b/tools/sql_model_gen.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
 java -cp apache-nlpcraft-incubating-0.5.0-all-deps.jar org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator --help
         </pre><p> NOTE: this utility is Java-based and can be run similarly from command line or any IDE.</p><p> At the time of this writing (NLPCraft ver. 0.5.0) this would produce the following output:</p><pre class="brush: plain">
 NAME:
diff --git a/tools/test_framework.html b/tools/test_framework.html
index 2468ed0..1aee39e 100644
--- a/tools/test_framework.html
+++ b/tools/test_framework.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
 public class AlarmTest {
     private NCTestClient cli;
 
diff --git a/using-rest.html b/using-rest.html
index 2202547..de40d81 100644
--- a/using-rest.html
+++ b/using-rest.html
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
+<!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="An open source API to convert natural language into actions."><meta name="author" content="NLPCraft."><link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" [...]
             https://localhost:8081/api/v1/signin
         </pre><p> where:<dl><dt><code>http</code><dd>Either <code>http</code> or <code>https</code> protocol.<dt><code>localhost:8081</code><dd>Host and port on which REST server is started. <code>localhost:8081</code> is the default configuration and can be <a href="server-and-probe.html">changed</a>.<dt><code>/api/v1</code><dd>Mandatory prefix indicating API version.<dt><code>/signin</code><dd>Specific REST call.</dl><div class="bq info"><p> <b>bin/nccurl.sh</b></p><p> <a target="wiki" [...]
         {