This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-513
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft-website.git
The following commit(s) were added to refs/heads/NLPCRAFT-513 by this push:
new 2d85c86 Page first-example.html fixes.
2d85c86 is described below
commit 2d85c86527be1a319bcf95cea11f6d08bd601a38
Author: Sergey Kamov <[email protected]>
AuthorDate: Sun Jan 22 01:35:38 2023 +0400
Page first-example.html fixes.
---
first-example.html | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/first-example.html b/first-example.html
index ecc6653..ab2a0a6 100644
--- a/first-example.html
+++ b/first-example.html
@@ -44,13 +44,13 @@ id: first-example
</p>
<pre class="brush: js, highlight: [7]">
ThisBuild / version := "0.1.0-SNAPSHOT"
- ThisBuild / scalaVersion := "3.1.3"
+ ThisBuild / scalaVersion := "3.2.2"
lazy val root = (project in file("."))
.settings(
name := "NLPCraft LightSwitch Example",
version := "{{site.latest_version}}",
libraryDependencies += "org.apache.nlpcraft" % "nlpcraft" %
"{{site.latest_version}}",
- libraryDependencies += "org.scalatest" %% "scalatest" %
"3.2.14" % "test"
+ libraryDependencies += "org.scalatest" %% "scalatest" %
"3.2.15" % "test"
)
</pre>
<p><b>NOTE: </b>use the latest versions of Scala and ScalaTest.</p>
@@ -82,7 +82,7 @@ id: first-example
<p>
We are going to start with declaring the static part of our model
using YAML which we will later load
in our Scala-based model implementation.
- Open <code>src/main/resources/<b>light_switch.yaml</b></code>
+ Open <code>src/main/resources/<b>lightswitch_model.yaml</b></code>
file and replace its content with the following YAML:
</p>
<pre class="brush: js, highlight: [1, 10, 17, 25]">
@@ -95,14 +95,14 @@ id: first-example
"<LIGHT>" : "{all|_}
{it|them|light|illumination|lamp|lamplight}"
elements:
- - id: "ls:loc"
+ - type: "ls:loc"
description: "Location of lights."
synonyms:
- "<ENTIRE_OPT> <FLOOR_OPT>
{kitchen|library|closet|garage|office|playroom|{dinning|laundry|play}
<TYPE>}"
- "<ENTIRE_OPT> <FLOOR_OPT>
{master|kid|children|child|guest|_} {bedroom|bathroom|washroom|storage}
{<TYPE>|_}"
- "<ENTIRE_OPT> {house|home|building|{1st|first}
floor|{2nd|second} floor}"
- - id: "ls:on"
+ - type: "ls:on"
groups:
- "act"
description: "Light switch ON action."
@@ -110,7 +110,7 @@ id: first-example
- "<ACTION> {on|up|_} <LIGHT> {on|up|_}"
- "<LIGHT> {on|up}"
- - id: "ls:off"
+ - type: "ls:off"
groups:
- "act"
description: "Light switch OFF action."
@@ -166,7 +166,7 @@ id: first-example
@NCIntentTerm("act") actEnt: NCEntity,
@NCIntentTerm("loc") locEnts: List[NCEntity]
): NCResult =
- val status = if actEnt.getId == "ls:on" then "on" else
"off"
+ val status = if actEnt.getType == "ls:on" then "on" else
"off"
val locations = if locEnts.isEmpty then "entire house"
else locEnts.map(_.mkText).mkString(", ")
// Add HomeKit, Arduino or other integration here.