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

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


The following commit(s) were added to refs/heads/NLPCRAFT-520 by this push:
     new c522e9e3 YAML and JSON configuration fixes.
c522e9e3 is described below

commit c522e9e31a37314df507b7850b26c95e853fb31d
Author: Sergey Kamov <[email protected]>
AuthorDate: Fri Jan 13 10:56:18 2023 +0400

    YAML and JSON configuration fixes.
---
 .../src/main/resources/lightswitch_model_fr.yaml       |  6 +++---
 .../src/main/resources/lightswitch_model_ru.yaml       |  6 +++---
 .../src/main/resources/lightswitch_model.yaml          |  6 +++---
 .../pizzeria/src/main/resources/pizzeria_model.yaml    | 18 +++++++++---------
 .../time/src/main/resources/time_model.yaml            |  2 +-
 .../nlp/parsers/impl/NCSemanticSourceReader.scala      |  4 ++--
 nlpcraft/src/test/resources/models/alarm_model.json    |  2 +-
 .../src/test/resources/models/lightswitch_model.yaml   |  6 +++---
 8 files changed, 25 insertions(+), 25 deletions(-)

diff --git 
a/nlpcraft-examples/lightswitch-fr/src/main/resources/lightswitch_model_fr.yaml 
b/nlpcraft-examples/lightswitch-fr/src/main/resources/lightswitch_model_fr.yaml
index 22862188..322603ee 100644
--- 
a/nlpcraft-examples/lightswitch-fr/src/main/resources/lightswitch_model_fr.yaml
+++ 
b/nlpcraft-examples/lightswitch-fr/src/main/resources/lightswitch_model_fr.yaml
@@ -24,14 +24,14 @@ macros:
   "<LIGHT>" : "{tout|_} {cela|lumière|éclairage|illumination|lampe}"
 
 elements:
-  - id: "ls:loc"
+  - type: "ls:loc"
     description: "Location of lights."
     synonyms:
       - "<ENTIRE_OPT> <FLOOR_OPT> 
{cuisine|bibliothèque|placard|garage|bureau|salle de jeux|{salle à 
manger|buanderie|jeu} <TYPE>}"
       - "<ENTIRE_OPT> <FLOOR_OPT> {maître|gamin|bébé|enfant|hôte|client|_} 
{coucher|bains|toilette|rangement} {<TYPE>|_}"
       - "<ENTIRE_OPT> {maison|foyer|bâtiment|{1er|premier} 
étage|chaussée|{2ème|deuxième} étage}"
 
-  - id: "ls:on"
+  - type: "ls:on"
     groups:
       - "act"
     description: "Light switch ON action."
@@ -39,7 +39,7 @@ elements:
       - "{<ACTION>|_} <LIGHT>"
       - "{<LIGHT>|_} <ACTION>"
 
-  - id: "ls:off"
+  - type: "ls:off"
     groups:
       - "act"
     description: "Light switch OFF action."
diff --git 
a/nlpcraft-examples/lightswitch-ru/src/main/resources/lightswitch_model_ru.yaml 
b/nlpcraft-examples/lightswitch-ru/src/main/resources/lightswitch_model_ru.yaml
index f8294acb..ccbcbb4f 100644
--- 
a/nlpcraft-examples/lightswitch-ru/src/main/resources/lightswitch_model_ru.yaml
+++ 
b/nlpcraft-examples/lightswitch-ru/src/main/resources/lightswitch_model_ru.yaml
@@ -22,12 +22,12 @@ macros:
   "<LIGHT_OPT>" : 
"{это|лампа|бра|люстра|светильник|лампочка|лампа|освещение|свет|электричество|электрика|_}"
 
 elements:
-  - id: "ls:loc"
+  - type: "ls:loc"
     description: "Location of lights."
     synonyms:
       - "<ENTIRE_OPT> 
{здание|помещение|дом|кухня|детская|кабинет|гостиная|спальня|ванная|туалет|{большая|обеденная|ванная|детская|туалетная}
 комната}"
 
-  - id: "ls:on"
+  - type: "ls:on"
     groups:
       - "act"
     description: "Light switch ON action."
@@ -35,7 +35,7 @@ elements:
       - "<LIGHT_OPT> <ENTIRE_OPT> <TURN_ON>"
       - "<TURN_ON> <ENTIRE_OPT> <LIGHT_OPT>"
 
-  - id: "ls:off"
+  - type: "ls:off"
     groups:
       - "act"
     description: "Light switch OFF action."
diff --git 
a/nlpcraft-examples/lightswitch/src/main/resources/lightswitch_model.yaml 
b/nlpcraft-examples/lightswitch/src/main/resources/lightswitch_model.yaml
index e063e252..37da1b5d 100644
--- a/nlpcraft-examples/lightswitch/src/main/resources/lightswitch_model.yaml
+++ b/nlpcraft-examples/lightswitch/src/main/resources/lightswitch_model.yaml
@@ -24,14 +24,14 @@ macros:
   "<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."
@@ -39,7 +39,7 @@ elements:
       - "<ACTION> {on|up|_} <LIGHT> {on|up|_}"
       - "<LIGHT> {on|up}"
 
-  - id: "ls:off"
+  - type: "ls:off"
     groups:
       - "act"
     description: "Light switch OFF action."
diff --git a/nlpcraft-examples/pizzeria/src/main/resources/pizzeria_model.yaml 
b/nlpcraft-examples/pizzeria/src/main/resources/pizzeria_model.yaml
index fd7c0b27..942db455 100644
--- a/nlpcraft-examples/pizzeria/src/main/resources/pizzeria_model.yaml
+++ b/nlpcraft-examples/pizzeria/src/main/resources/pizzeria_model.yaml
@@ -16,56 +16,56 @@
 #
 
 elements:
-  - id: "ord:pizza"
+  - type: "ord:pizza"
     description: "Kinds of pizza."
     values:
       "margherita": [ ]
       "carbonara": [ ]
       "marinara": [ ]
 
-  - id: "ord:pizza:size"
+  - type: "ord:pizza:size"
     description: "Size of pizza."
     values:
       "small": [ "{small|smallest|min|minimal|tiny} {size|piece|_}" ]
       "medium": [ "{medium|intermediate|normal|regular} {size|piece|_}" ]
       "large": [ "{big|biggest|large|max|maximum|huge|enormous} 
{size|piece|_}" ]
 
-  - id: "ord:drink"
+  - type: "ord:drink"
     description: "Kinds of drinks."
     values:
       "tea": [ ]
       "coffee": [ ]
       "cola": [ "{pepsi|sprite|dr. pepper|dr pepper|fanta|soda|cola|coca 
cola|cocacola|coca-cola}" ]
 
-  - id: "ord:yes"
+  - type: "ord:yes"
     description: "Confirmation (yes)."
     synonyms:
       - 
"{yes|yeah|right|fine|nice|excellent|good|correct|sure|ok|exact|exactly|agree}"
       - "{you are|_} {correct|right}"
 
-  - id: "ord:no"
+  - type: "ord:no"
     description: "Confirmation (no)."
     synonyms:
       - "{no|nope|incorrect|wrong}"
       - "{you are|_} {not|are not|aren't} {correct|right}"
 
-  - id: "ord:stop"
+  - type: "ord:stop"
     description: "Stop and cancel all."
     synonyms:
       - "{stop|cancel|clear|interrupt|quit|close} {it|all|everything|_}"
 
-  - id: "ord:status"
+  - type: "ord:status"
     description: "Order status information."
     synonyms:
       - "{present|current|_} {order|_} {status|state|info|information}"
       - "what {already|_} ordered"
 
-  - id: "ord:finish"
+  - type: "ord:finish"
     description: "The order is over."
     synonyms:
       - "{i|everything|order|_} {be|_} {finish|ready|done|over|confirmed}"
 
-  - id: "ord:menu"
+  - type: "ord:menu"
     description: "Order menu."
     synonyms:
       - "{menu|carte|card}"
diff --git a/nlpcraft-examples/time/src/main/resources/time_model.yaml 
b/nlpcraft-examples/time/src/main/resources/time_model.yaml
index d3798dfb..bbd3c5ba 100644
--- a/nlpcraft-examples/time/src/main/resources/time_model.yaml
+++ b/nlpcraft-examples/time/src/main/resources/time_model.yaml
@@ -20,7 +20,7 @@ macros:
   "<CUR>": "{current|present|now|local}"
   "<TIME>": "{time <OF> day|day 
time|date|time|moment|datetime|hour|o'clock|clock|date time|date and time|time 
and date}"
 elements:
-  - id: "x:time"
+  - type: "x:time"
     description: "Date and/or time token indicator."
     synonyms:
       - "{<CUR>|_} <TIME>"
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/impl/NCSemanticSourceReader.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/impl/NCSemanticSourceReader.scala
index 6e8fc635..3b262658 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/impl/NCSemanticSourceReader.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/impl/NCSemanticSourceReader.scala
@@ -56,7 +56,7 @@ private[parsers] case class NCSemanticSourceData(macros: 
Map[String, String], el
   */
 private[parsers] object NCSemanticSourceReader:
     case class Element  (
-        id: String,
+        `type`: String,
         description: String,
         groups: Seq[String],
         synonyms: Set[String],
@@ -71,7 +71,7 @@ private[parsers] object NCSemanticSourceReader:
         if e == null then null
         else
             new NCPropertyMapAdapter with NCSemanticElement:
-                override val getType: String = e.id
+                override val getType: String = e.`type`
                 override val getGroups: Set[String] =
                     val gs = e.groups
 
diff --git a/nlpcraft/src/test/resources/models/alarm_model.json 
b/nlpcraft/src/test/resources/models/alarm_model.json
index aad545e9..d827ffe3 100644
--- a/nlpcraft/src/test/resources/models/alarm_model.json
+++ b/nlpcraft/src/test/resources/models/alarm_model.json
@@ -18,7 +18,7 @@
 {
     "elements": [
         {
-            "id": "x:alarm",
+            "type": "x:alarm",
             "description": "Alarm token indicator.",
             "synonyms": [
                 "{ping|buzz|wake|call|hit} {me|up|me up|_}",
diff --git a/nlpcraft/src/test/resources/models/lightswitch_model.yaml 
b/nlpcraft/src/test/resources/models/lightswitch_model.yaml
index e063e252..37da1b5d 100644
--- a/nlpcraft/src/test/resources/models/lightswitch_model.yaml
+++ b/nlpcraft/src/test/resources/models/lightswitch_model.yaml
@@ -24,14 +24,14 @@ macros:
   "<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."
@@ -39,7 +39,7 @@ elements:
       - "<ACTION> {on|up|_} <LIGHT> {on|up|_}"
       - "<LIGHT> {on|up}"
 
-  - id: "ls:off"
+  - type: "ls:off"
     groups:
       - "act"
     description: "Light switch OFF action."

Reply via email to