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/13 01:58:00 UTC
[incubator-nlpcraft-website] branch master updated: Fix for
NLPCRAFT-79 + SQL model example.
This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft-website.git
The following commit(s) were added to refs/heads/master by this push:
new 74483ad Fix for NLPCRAFT-79 + SQL model example.
74483ad is described below
commit 74483ad45d3b37f63ebc96c8e2b4fdf046a6ca79
Author: Aaron Radzinzski <ar...@datalingvo.com>
AuthorDate: Fri Jun 12 18:57:40 2020 -0700
Fix for NLPCRAFT-79 + SQL model example.
---
README.md | 2 +-
_includes/quick-links.html | 2 +-
_layouts/blog.html | 2 +-
_layouts/documentation.html | 7 +++++++
_scss/misc.scss | 7 +++++++
data-model.html | 2 +-
examples/alarm_clock.html | 4 ++--
examples/light_switch.html | 4 ++--
examples/{weather_bot.html => sql_model.html} | 14 +++++++-------
examples/weather_bot.html | 4 ++--
getting-started.html | 4 ++--
index.html | 4 ++--
intent-matching.html | 6 +++---
tools/embedded_probe.html | 2 +-
tools/sql_model_gen.html | 2 +-
tools/test_framework.html | 2 +-
16 files changed, 41 insertions(+), 27 deletions(-)
diff --git a/README.md b/README.md
index b88ecac..3f3ede7 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ This repo is for Apache NLPCraft [website](https://nlpcraft.apache.org/).
NLPCraft is free and easy to use, it securely works with any private data source, and has no hardware or software
lock-in:
- * View & run [examples](https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples)
+ * View & run [examples](https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples)
* Latest [Javadoc](https://github.com/apache/incubator-nlpcraft/apis/latest/index.html) and [REST APIs](https://nlpcraft.apache.org/using-rest.html)
* Download & Maven/Grape/Gradle/SBT [instructions](https://nlpcraft.apache.org/download.html)
* File a bug or improvement in [JIRA](https://issues.apache.org/jira/projects/NLPCRAFT)
diff --git a/_includes/quick-links.html b/_includes/quick-links.html
index e381b1d..d6cb168 100644
--- a/_includes/quick-links.html
+++ b/_includes/quick-links.html
@@ -17,7 +17,7 @@
<li class="side-nav-title">Quick Links</li>
<li>
- <i class="fab fa-fw fa-github mr-2"></i><a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples">Examples</a>
+ <i class="fab fa-fw fa-github mr-2"></i><a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples">Examples</a>
</li>
<li>
<i class="fab fa-fw fa-java mr-2"></i><a target="_" href="/apis/latest/index.html">Javadoc</a>
diff --git a/_layouts/blog.html b/_layouts/blog.html
index ffc35c8..31f99e1 100644
--- a/_layouts/blog.html
+++ b/_layouts/blog.html
@@ -49,7 +49,7 @@ layout: default
<li>
<img alt="" class="quick-link-img mr-2" src="/images/github_logo.png"><a
target="github"
- href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples">Examples</a>
+ href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples">Examples</a>
</li>
<li>
<i class="fab fa-java mr-2"></i><a target="_" href="/apis/latest/index.html">Javadoc</a>
diff --git a/_layouts/documentation.html b/_layouts/documentation.html
index 1d697b2..074e27d 100644
--- a/_layouts/documentation.html
+++ b/_layouts/documentation.html
@@ -149,6 +149,13 @@ layout: interior
<a href="/examples/weather_bot.html">Weather Bot</a>
{% endif %}
</li>
+ <li>
+ {% if page.id == "sql_model" %}
+ <a class="active" href="/examples/sql_model.html">SQL Model</a>
+ {% else %}
+ <a href="/examples/sql_model.html">SQL Model</a>
+ {% endif %}
+ </li>
</ul>
</div>
diff --git a/_scss/misc.scss b/_scss/misc.scss
index 6327fc2..9591af8 100644
--- a/_scss/misc.scss
+++ b/_scss/misc.scss
@@ -388,8 +388,15 @@ code {
}
}
+.complexity-three-star {
+ i {
+ color: #000;
+ }
+}
+
.img-fluid {
max-width: 800px !important;
+ width: 100% !important;
}
diff --git a/data-model.html b/data-model.html
index d2e3a56..de9b7b9 100644
--- a/data-model.html
+++ b/data-model.html
@@ -249,7 +249,7 @@ id: data_model
configuration you need to use <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCModelFileAdapter.html">NCModelFileAdapter</a>
adapter when creating your data model. Here are JSON and YAML templates and you can find more details in
<a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCModel.html">NCModel</a> Javadoc and in
- <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples">examples</a>.
+ <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples">examples</a>.
</p>
<nav>
diff --git a/examples/alarm_clock.html b/examples/alarm_clock.html
index b00f0dd..f77c245 100644
--- a/examples/alarm_clock.html
+++ b/examples/alarm_clock.html
@@ -31,8 +31,8 @@ id: alarm_clock
simply print out "BEEP BEEP BEEP" in the data probe console.
</p>
<p>
- Complexity: <span class="complexity-one-star"><i class="fas fa-star"></i><i class="far fa-star"></i><i class="far fa-star"></i></span><br/>
- Source code: <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples/alarm">GitHub</a>
+ Complexity: <span class="complexity-one-star"><i class="fas fa-star"></i> <i class="far fa-star"></i> <i class="far fa-star"></i></span><br/>
+ Source code: <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/alarm">GitHub</a>
</p>
</section>
<section id="new_project">
diff --git a/examples/light_switch.html b/examples/light_switch.html
index e429b31..f37efcd 100644
--- a/examples/light_switch.html
+++ b/examples/light_switch.html
@@ -31,8 +31,8 @@ id: light_switch
controllers.
</p>
<p>
- Complexity: <span class="complexity-one-star"><i class="fas fa-star"></i><i class="far fa-star"></i><i class="far fa-star"></i></span><br/>
- Source code: <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples/lightswitch">GitHub</a>
+ Complexity: <span class="complexity-one-star"><i class="fas fa-star"></i> <i class="far fa-star"></i> <i class="far fa-star"></i></span><br/>
+ Source code: <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch">GitHub</a>
</p>
</section>
<section id="new_project">
diff --git a/examples/weather_bot.html b/examples/sql_model.html
similarity index 98%
copy from examples/weather_bot.html
copy to examples/sql_model.html
index 40121d1..92f803b 100644
--- a/examples/weather_bot.html
+++ b/examples/sql_model.html
@@ -1,7 +1,7 @@
---
-active_crumb: Weather Bot <code><sub>ex</sub></code>
+active_crumb: SQL Model <code><sub>ex</sub></code>
layout: documentation
-id: weather_bot
+id: sql_model
---
<!--
@@ -30,8 +30,8 @@ id: weather_bot
REST service for the actual weather information.
</p>
<p>
- Complexity: <span class="complexity-two-star"><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="far fa-star"></i></span><br/>
- Source code: <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples/weather">GitHub</a>
+ Complexity: <span class="complexity-three-star"><i class="fas fa-gem"></i> <i class="fas fa-gem"></i> <i class="fas fa-gem"></i></span><br/>
+ Source code: <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather">GitHub</a>
</p>
</section>
<section id="new_project">
@@ -211,7 +211,7 @@ id: weather_bot
) {
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,
@@ -220,7 +220,7 @@ id: weather_bot
) {
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,
@@ -423,7 +423,7 @@ class WeatherTest {
private static final Gson GSON = new Gson();
private static final Type TYPE_MAP_RESP = new TypeToken<HashMap<String, Object>>() {}.getType();
private NCTestClient cli;
-
+
private void checkIntent(String txt, String intentId, boolean shouldBeSame) throws NCException, IOException {
NCTestResult res = cli.ask(txt);
diff --git a/examples/weather_bot.html b/examples/weather_bot.html
index 40121d1..ba6863c 100644
--- a/examples/weather_bot.html
+++ b/examples/weather_bot.html
@@ -30,8 +30,8 @@ id: weather_bot
REST service for the actual weather information.
</p>
<p>
- Complexity: <span class="complexity-two-star"><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="far fa-star"></i></span><br/>
- Source code: <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples/weather">GitHub</a>
+ Complexity: <span class="complexity-two-star"><i class="fas fa-square"></i> <i class="fas fa-square"></i> <i class="far fa-square"></i></span><br/>
+ Source code: <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather">GitHub</a>
</p>
</section>
<section id="new_project">
diff --git a/getting-started.html b/getting-started.html
index 68715e2..681e782 100644
--- a/getting-started.html
+++ b/getting-started.html
@@ -26,7 +26,7 @@ id: getting_started
<h2 class="section-title">Getting Started</h2>
<p>
In this section we'll take a quick 10 minutes look at running and
- testing <a href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples" target="github">examples</a>
+ testing <a href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples" target="github">examples</a>
shipped with NLPCraft along with
running the main components of NLPCraft - data probe and REST server. We assume the following:
</p>
@@ -167,7 +167,7 @@ id: getting_started
<section id="querying">
<h2 class="section-title">Weather Forecast</h2>
<p>
- We'll be testing <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples/weather">Weather Example</a>
+ We'll be testing <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather">Weather Example</a>
to ask questions about weather forecast using REST APIs. This example returns a comprehensive JSON weather
data for variety of different inquiries about the past, present or future weather conditions.
</p>
diff --git a/index.html b/index.html
index 7e044d9..095238e 100644
--- a/index.html
+++ b/index.html
@@ -84,7 +84,7 @@ layout: default
<div class="gh-btn">
<a
class="github-button"
- href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples"
+ href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples"
aria-label="NLPCraft examples on GitHub">Examples</a>
</div>
<a target=_ href="https://gitter.im/apache-nlpcraft/community"><img alt="Gitter" src="https://badges.gitter.im/apache-nlpcraft/community.svg"></a>
@@ -288,7 +288,7 @@ layout: default
</p>
</div>
<div class="col-5" style="margin-top: 50px;">
- <a class="twitter-timeline" data-width="500" data-height="400" data-theme="light" href="https://twitter.com/ApacheNLPCraft?ref_src=twsrc%5Etfw">Tweets by ApacheNLPCraft</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
+ <a class="twitter-timeline" data-height="400" data-theme="light" href="https://twitter.com/ApacheNLPCraft?ref_src=twsrc%5Etfw">Tweets by ApacheNLPCraft</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<a href="https://twitter.com/apachenlpcraft?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-size="large" data-show-count="false">Follow @apachenlpcraft</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
diff --git a/intent-matching.html b/intent-matching.html
index 1a1b448..319860c 100644
--- a/intent-matching.html
+++ b/intent-matching.html
@@ -79,7 +79,7 @@ id: intent_matching
</p>
<p>
An intent from
- <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples/lightswitch">Light Switch</a> Scala example:
+ <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch">Light Switch</a> Scala example:
</p>
<pre class="brush: java">
@NCIntent("intent=act conv=false term(act)={groups @@ 'act'} term(loc)={trim(id) == 'ls:loc'}*")
@@ -143,7 +143,7 @@ id: intent_matching
</ul>
<br/>
<p>
- In the following <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples/alarm">Alarm Clock</a> Java example
+ In the following <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/alarm">Alarm Clock</a> Java example
the intent is defined in JSON model definition and referenced in Java code using <code>@NCIntentTerm</code>
annotation:
</p>
@@ -206,7 +206,7 @@ id: intent_matching
</li>
<li>
Second term is defined as a zero or up to seven numeric built-in <code>nlpcraft:num</code> tokens that
- have unit type of <code>datetime</code> and are single numbers. Note that <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples/alarm">Alarm Clock</a>
+ have unit type of <code>datetime</code> and are single numbers. Note that <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/alarm">Alarm Clock</a>
model allows zero tokens in this term which would mean the current time.
</li>
<li>
diff --git a/tools/embedded_probe.html b/tools/embedded_probe.html
index ed2435a..ba44aa5 100644
--- a/tools/embedded_probe.html
+++ b/tools/embedded_probe.html
@@ -140,7 +140,7 @@ public class AlarmTest {
<section id="examples">
<h2 class="section-title">Examples</h2>
<p>
- All <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples">examples</a>
+ All <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples">examples</a>
shipped with NLPCraft utilize embedded probes in their unit tests.
</p>
</section>
diff --git a/tools/sql_model_gen.html b/tools/sql_model_gen.html
index 52fb2a8..4b70f8b 100644
--- a/tools/sql_model_gen.html
+++ b/tools/sql_model_gen.html
@@ -203,7 +203,7 @@ EXAMPLES:
<section id="examples">
<h2 class="section-title">Examples</h2>
<p>
- SQL model generator is used by <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples/sql">SQL Model</a> example. This example comes with two YAML models:
+ SQL model generator is used by <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql">SQL Model</a> example. This example comes with two YAML models:
</p>
<ul>
<li><code>sql_model_init.yaml</code> - original generated model straight out of the SQL model generator.</li>
diff --git a/tools/test_framework.html b/tools/test_framework.html
index 2cd613d..fa2b782 100644
--- a/tools/test_framework.html
+++ b/tools/test_framework.html
@@ -134,7 +134,7 @@ public class AlarmTest {
<section id="examples">
<h2 class="section-title">Examples</h2>
<p>
- All <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples">examples</a>
+ All <a target="github" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples">examples</a>
shipped with NLPCraft utilize the test framework in their unit tests.
</p>
</section>