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 2021/01/16 03:00:01 UTC

[incubator-nlpcraft-website] branch master updated: Final fixes for docs.

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 79248f4  Final fixes for docs.
79248f4 is described below

commit 79248f453c553ec1f0bc16338fc3ab35ebdbd471
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Fri Jan 15 18:59:49 2021 -0800

    Final fixes for docs.
---
 examples/alarm_clock.html  | 40 +++++++++++++++++++++++++++++++-
 examples/light_switch.html | 42 +++++++++++++++++++++++++++++++++-
 examples/sql_model.html    | 57 +++++++++++++++++++++++++++++++++++++++-------
 examples/weather_bot.html  | 40 +++++++++++++++++++++++++++++++-
 first-example.html         |  2 +-
 tools/script.html          | 21 ++++-------------
 6 files changed, 174 insertions(+), 28 deletions(-)

diff --git a/examples/alarm_clock.html b/examples/alarm_clock.html
index 6a2852e..366d926 100644
--- a/examples/alarm_clock.html
+++ b/examples/alarm_clock.html
@@ -257,6 +257,19 @@ public class AlarmClock extends NCModelFileAdapter {
             </li>
         </ul>
     </section>
+    <section id="build_project">
+        <h3 class="section-title">Build Project</h3>
+        <p>
+            Once we have our model ready let's go to <code>~/AlarmClock</code> directory and run the Maven build:
+        </p>
+        <pre class="brush: bash">
+            $ cd ~/AlarmClock
+            $ mvn clean package
+        </pre>
+        <p>
+            At this stage we have our project built and we are ready to start testing.
+        </p>
+    </section>
     <section id="start_server">
         <h3 class="section-title">Start Server</h3>
         <p>
@@ -286,7 +299,7 @@ public class AlarmClock extends NCModelFileAdapter {
         </p>
         <ul>
             <li>
-                REST server is a "fore-and-forget" component that you generally need to start only once.
+                <i style="color: #F39C12" class="fa fa-exclamation-triangle"></i> REST server is a "fire-and-forget" component that you generally needs to start only once.
             </li>
             <li>
                 Run <code>bin/nlpcraft.sh help --cmd=start-server</code> to get a full help on this command.
@@ -339,6 +352,29 @@ public class AlarmClock extends NCModelFileAdapter {
             <img style="max-width: 667px !important;" class="img-fluid" alt="" src="/images/alarm-clock-test.png">
         </p>
     </section>
+    <section id="rinse">
+        <h2 class="section-title">Rinse <span class="amp">&amp;</span> Repeat</h2>
+        <p>
+            Typical development cycle consists of:
+        </p>
+        <ul>
+            <li>
+                <a href="#model">Modifying the model</a>
+            </li>
+            <li>
+                <a href="#build_project">Re-building the project</a>
+            </li>
+            <li>
+                <a href="#testing">Re-running the test</a>
+            </li>
+        </ul>
+        <p>
+            All of these operations can be performed from <a href="/tools/script.html">NLPCraft CLI</a> in REPL mode or from any IDE.
+        </p>
+        <p>
+            NOTE: you don't need to restart REST server every time - it only needs to be started once.
+        </p>
+    </section>
     <section>
         <h2 class="section-title">Done! 👌</h2>
         <p>
@@ -353,8 +389,10 @@ public class AlarmClock extends NCModelFileAdapter {
         <li><a href="#new_project">New Project</a></li>
         <li><a href="#model">Data Model</a></li>
         <li><a href="#code">Model Class</a></li>
+        <li><a href="#build_project">Build Project</li>
         <li><a href="#start_server">Start Server</a></li>
         <li><a href="#testing">Testing</a></li>
+        <li><a href="#rinse">Rinse <span class="amp">&amp;</span> Repeat</a></li>
         {% include quick-links.html %}
     </ul>
 </div>
diff --git a/examples/light_switch.html b/examples/light_switch.html
index d59616f..28b1e15 100644
--- a/examples/light_switch.html
+++ b/examples/light_switch.html
@@ -145,6 +145,8 @@ intents:
             Now that our model is ready let's create a Java class that would load this model and provide the actual
             callback for when the intent <code>ls</code> is detected in the user input.
         </p>
+    </section>
+    <section id="code">
         <h3 class="section-title">Model Class</h3>
         <p>
             Open <code>src/main/scala/demo/<b>LightSwitch.scala</b></code> with the following code:
@@ -216,6 +218,19 @@ class LightSwitch extends NCModelFileAdapter("light_switch.yaml") {
             </li>
         </ul>
     </section>
+    <section id="build_project">
+        <h3 class="section-title">Build Project</h3>
+        <p>
+            Once we have our model ready let's go to <code>~/LightSwitch</code> directory and run the Maven build:
+        </p>
+        <pre class="brush: bash">
+            $ cd ~/LightSwitch
+            $ mvn clean package
+        </pre>
+        <p>
+            At this stage we have our project built and we are ready to start testing.
+        </p>
+    </section>
     <section id="start_server">
         <h3 class="section-title">Start Server</h3>
         <p>
@@ -245,7 +260,7 @@ class LightSwitch extends NCModelFileAdapter("light_switch.yaml") {
         </p>
         <ul>
             <li>
-                REST server is a "fore-and-forget" component that you generally need to start only once.
+                <i style="color: #F39C12" class="fa fa-exclamation-triangle"></i> REST server is a "fore-and-forget" component that you generally need to start only once.
             </li>
             <li>
                 Run <code>bin/nlpcraft.sh help --cmd=start-server</code> to get a full help on this command.
@@ -298,6 +313,29 @@ class LightSwitch extends NCModelFileAdapter("light_switch.yaml") {
             <img style="max-width: 928px !important;" class="img-fluid" alt="" src="/images/light-switch-test.png">
         </p>
     </section>
+    <section id="rinse">
+        <h2 class="section-title">Rinse <span class="amp">&amp;</span> Repeat</h2>
+        <p>
+            Typical development cycle consists of:
+        </p>
+        <ul>
+            <li>
+                <a href="#model">Modifying the model</a>
+            </li>
+            <li>
+                <a href="#build_project">Re-building the project</a>
+            </li>
+            <li>
+                <a href="#testing">Re-running the test</a>
+            </li>
+        </ul>
+        <p>
+            All of these operations can be performed from <a href="/tools/script.html">NLPCraft CLI</a> in REPL mode or from any IDE.
+        </p>
+        <p>
+            NOTE: you don't need to restart REST server every time - it only needs to be started once.
+        </p>
+    </section>
     <section>
         <h2 class="section-title">Done! 👌</h2>
         <p>
@@ -312,8 +350,10 @@ class LightSwitch extends NCModelFileAdapter("light_switch.yaml") {
         <li><a href="#new_project">New Project</a></li>
         <li><a href="#model">Data Model</a></li>
         <li><a href="#code">Model Class</a></li>
+        <li><a href="#build_project">Build Project</a></li>
         <li><a href="#start_server">Start Server</a></li>
         <li><a href="#testing">Testing</a></li>
+        <li><a href="#rinse">Rinse <span class="amp">&amp;</span> Repeat</a></li>
         {% include quick-links.html %}
     </ul>
 </div>
diff --git a/examples/sql_model.html b/examples/sql_model.html
index 616bd0d..9717e58 100644
--- a/examples/sql_model.html
+++ b/examples/sql_model.html
@@ -95,16 +95,18 @@ id: sql_model
             <figcaption><b>Fig 1.</b> SQL Schema</figcaption>
         </figure>
         <p>
-            You can find SQL script creating this database and populating it with the sample data at <code>db/northwind.sql</code>
+            You can find SQL script creating this database and populating it with the sample data at
+            <a href="https://github.com/apache/incubator-nlpcraft/blob/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/db/northwind.sql" target="github"><code>db/northwind.sql</code></a>
             file in the root of the example.
         </p>
     </section>
     <section id="h2">
         <h3 class="section-title">H2 Database</h3>
         <p>
-            In our example we are using H2 database instance. For convenience, example provides a command line application <code>db/SqlServer.java</code>
+            In our example we are using H2 database instance. For convenience, example provides a command line application
+            <a href="https://github.com/apache/incubator-nlpcraft/blob/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/db/SqlServer.scala" target="github"><code>db/SqlServer.scala</code></a>
             that automatically starts local H2 database instance with default configuration (localhost on port 9092) and initializes it
-            using <code>db/northwind.sql</code> script.
+            using <a href="https://github.com/apache/incubator-nlpcraft/blob/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/db/northwind.sql" target="github"><code>db/northwind.sql</code></a> script.
         </p>
     </section>
     <section id="model">
@@ -124,7 +126,7 @@ id: sql_model
         </p>
         <ul>
             <li>
-                <code>sql_model_init.yaml</code> - the initial file that was generated straight out of
+                <a href="https://github.com/apache/incubator-nlpcraft/blob/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/sql_model_init.yaml" target="github"><code>sql_model_init.yaml</code></a> - the initial file that was generated straight out of
                 SQL Model Generator (see above for the instructions).
             </li>
         </ul>
@@ -136,22 +138,36 @@ id: sql_model
         </p>
         <ul>
             <li>
-                <code>SqlModel.java</code> - the code behind the data model that loads YAML-defined model and
+                <a href="https://github.com/apache/incubator-nlpcraft/blob/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/SqlModel.scala" target="github"><code>SqlModel.scala</code></a> - the code behind the data model that loads YAML-defined model and
                 defines all intents.
             </li>
             <li>
-                <code>db/Builder.java</code> - the main utility that takes object model provided by
+                <a href="https://github.com/apache/incubator-nlpcraft/blob/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/db/SqlBuilder.scala" target="github"><code>db/SqlBuilder.scala</code></a> - the main utility that takes object model provided by
                 <a href="/tools/sql_model_gen.html">SQL Model Generation</a>
                 and builds a SQL query to execute. Note that we elected to build this functionality
                 from scratch to illustrate how it can be done. You are free, of course, to use many
                 of the existing libraries to help achieve this goal.
             </li>
             <li>
-                <code>SqlTest.java</code> - unit test for this example. Note that this test
+                <a href="https://github.com/apache/incubator-nlpcraft/blob/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/sql/SqlTest.scala" target="github"><code>SqlTest.scala</code></a> - unit test for this example. Note that this test
                 provides additional utility of testing each input sentence against the result SQL statement.
             </li>
         </ul>
     </section>
+    <section id="build_project">
+        <h3 class="section-title">Build Project</h3>
+        <p>
+            Assuming that project is located in <code>~/SqlModel</code> folder - let's go to into this directory and
+            run the Maven build:
+        </p>
+        <pre class="brush: bash">
+            $ cd ~/SqlModel
+            $ mvn clean package
+        </pre>
+        <p>
+            At this stage we have our project built and we are ready to start testing.
+        </p>
+    </section>
     <section id="start_server">
         <h3 class="section-title">Start Server</h3>
         <p>
@@ -181,7 +197,7 @@ id: sql_model
         </p>
         <ul>
             <li>
-                REST server is a "fore-and-forget" component that you generally need to start only once.
+                <i style="color: #F39C12" class="fa fa-exclamation-triangle"></i> REST server is a "fore-and-forget" component that you generally need to start only once.
             </li>
             <li>
                 Run <code>bin/nlpcraft.sh help --cmd=start-server</code> to get a full help on this command.
@@ -224,6 +240,29 @@ id: sql_model
             </li>
         </ul>
     </section>
+    <section id="rinse">
+        <h2 class="section-title">Rinse <span class="amp">&amp;</span> Repeat</h2>
+        <p>
+            Typical development cycle consists of:
+        </p>
+        <ul>
+            <li>
+                <a href="#model">Modifying the model</a>
+            </li>
+            <li>
+                <a href="#build_project">Re-building the project</a>
+            </li>
+            <li>
+                <a href="#testing">Re-running the test</a>
+            </li>
+        </ul>
+        <p>
+            All of these operations can be performed from <a href="/tools/script.html">NLPCraft CLI</a> in REPL mode or from any IDE.
+        </p>
+        <p>
+            NOTE: you don't need to restart REST server every time - it only needs to be started once.
+        </p>
+    </section>
     <section>
         <h2 class="section-title">Done! 👌</h2>
         <p>
@@ -239,8 +278,10 @@ id: sql_model
         <li><a href="#sql">Sample Database</a></li>
         <li><a href="#model">Data Model</a></li>
         <li><a href="#impl">Implementation</a></li>
+        <li><a href="#build_project">Build Project</a></li>
         <li><a href="#start_server">Start Server</a></li>
         <li><a href="#testing">Testing</a></li>
+        <li><a href="#rinse">Rinse <span class="amp">&amp;</span> Repeat</a></li>
         {% include quick-links.html %}
     </ul>
 </div>
diff --git a/examples/weather_bot.html b/examples/weather_bot.html
index 7e92086..e4813e0 100644
--- a/examples/weather_bot.html
+++ b/examples/weather_bot.html
@@ -366,6 +366,19 @@ public class Weather extends NCModelFileAdapter {
             </li>
         </ul>
     </section>
+    <section id="build_project">
+        <h3 class="section-title">Build Project</h3>
+        <p>
+            Once we have our model ready let's go to <code>~/Weather</code> directory and run the Maven build:
+        </p>
+        <pre class="brush: bash">
+            $ cd ~/Weather
+            $ mvn clean package
+        </pre>
+        <p>
+            At this stage we have our project built and we are ready to start testing.
+        </p>
+    </section>
     <section id="start_server">
         <h3 class="section-title">Start Server</h3>
         <p>
@@ -395,7 +408,7 @@ public class Weather extends NCModelFileAdapter {
         </p>
         <ul>
             <li>
-                REST server is a "fore-and-forget" component that you generally need to start only once.
+                <i style="color: #F39C12" class="fa fa-exclamation-triangle"></i> REST server is a "fore-and-forget" component that you generally need to start only once.
             </li>
             <li>
                 Run <code>bin/nlpcraft.sh help --cmd=start-server</code> to get a full help on this command.
@@ -448,6 +461,29 @@ public class Weather extends NCModelFileAdapter {
             <img style="max-width: 871px !important;" class="img-fluid" alt="" src="/images/weather-bot-test.png">
         </p>
     </section>
+    <section id="rinse">
+        <h2 class="section-title">Rinse <span class="amp">&amp;</span> Repeat</h2>
+        <p>
+            Typical development cycle consists of:
+        </p>
+        <ul>
+            <li>
+                <a href="#model">Modifying the model</a>
+            </li>
+            <li>
+                <a href="#build_project">Re-building the project</a>
+            </li>
+            <li>
+                <a href="#testing">Re-running the test</a>
+            </li>
+        </ul>
+        <p>
+            All of these operations can be performed from <a href="/tools/script.html">NLPCraft CLI</a> in REPL mode or from any IDE.
+        </p>
+        <p>
+            NOTE: you don't need to restart REST server every time - it only needs to be started once.
+        </p>
+    </section>
     <section>
         <h2 class="section-title">Done! 👌</h2>
         <p>
@@ -462,8 +498,10 @@ public class Weather extends NCModelFileAdapter {
         <li><a href="#new_project">New Project</a></li>
         <li><a href="#model">Data Model</a></li>
         <li><a href="#tools">External Tools</a></li>
+        <li><a href="#build_project">Build Project</a></li>
         <li><a href="#start_server">Start Server</a></li>
         <li><a href="#testing">Testing</a></li>
+        <li><a href="#rinse">Rinse <span class="amp">&amp;</span> Repeat</a></li>
         {% include quick-links.html %}
     </ul>
 </div>
diff --git a/first-example.html b/first-example.html
index b7eac9c..92655db 100644
--- a/first-example.html
+++ b/first-example.html
@@ -25,7 +25,7 @@ id: first_example
     <section id="setup">
         <h2 class="section-title">Overview</h2>
         <p>
-            In the next 15 minutes we'll develop a prototypical light switch that can be controlled through the natural language.
+            Let's develop a prototypical light switch that can be controlled through the natural language.
             We'll keep <a target=_ href="https://cloud.google.com/speech-to-text/">speech-to-text conversion</a> and integration
             with <a target=_    href="https://developer.apple.com/homekit/">HomeKit</a> or
             <a href="https://www.arduino.cc/" target=_>Ardunio</a> outside of this example - and concentrate only on understanding the natural
diff --git a/tools/script.html b/tools/script.html
index 2cc26d4..f8d1b9a 100644
--- a/tools/script.html
+++ b/tools/script.html
@@ -122,23 +122,12 @@ id: script
             command with a <code>$</code> symbol. For example:
         </p>
         <pre class="brush: bash">
-            > $git pull
+            > $git pull # Runs 'git pull' in the current directory.
+            > $vi /home/myproject/pom.xml # Edit 'pom.xml' using vi.
+            > $emacs /home/myproject/MyModel.scala # Edit 'MyModel.scala' using emacs.
+            > $ls -la # Run 'ls-la' Unix command.
+            > $cmd /c dir # Runs Windows 'dir' command in a separate shell.
         </pre>
-        <p style="margin-left: 20px">
-            Runs <code>git pull</code> command in the current directory.
-        </p>
-        <pre class="brush: bash">
-            > $ls -la
-        </pre>
-        <p style="margin-left: 20px">
-            Runs <code>ls -la</code> Unix shell command.
-        </p>
-        <pre class="brush: bash">
-            > $cmd /c dir
-        </pre>
-        <p style="margin-left: 20px">
-            Runs Windows <code>dir</code> command in the current directory using a separate shell.
-        </p>
         <p>
             Note that <em>stdin</em>, <em>stderr</em> and <em>stdout</em> of the new process will inherit from running <code>bin/nlpcraft.{sh|cmd}</code> script process.
             Running OS commands makes the most sense in REPL mode where you don't want to lose a session context while