You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by if...@apache.org on 2021/03/25 03:57:53 UTC

[incubator-nlpcraft] branch NLPCRAFT-91 updated (f70b51e -> 1eae3ee)

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

ifropc pushed a change to branch NLPCRAFT-91
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git.


    from f70b51e  Update minecraft.yaml
     new 214b38e  NLPCRAFT-91: Fix for new IDL
     new 1eae3ee  NLPCRAFT-91: Prefix player name with #

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/nlpcraft/example/MinecraftModel.kt  |  7 +++--
 .../src/main/resources/minecraft.yaml              | 35 +++++++++-------------
 2 files changed, 18 insertions(+), 24 deletions(-)

[incubator-nlpcraft] 02/02: NLPCRAFT-91: Prefix player name with #

Posted by if...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1eae3ee7691d4ebf18771011c4d3dbf92c846087
Author: Ifropc <if...@apache.org>
AuthorDate: Wed Mar 24 20:57:41 2021 -0700

    NLPCRAFT-91: Prefix player name with #
---
 .../kotlin/org/apache/nlpcraft/example/MinecraftModel.kt  |  7 ++++---
 .../minecraft-model/src/main/resources/minecraft.yaml     | 15 ++++-----------
 2 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/nlpcraft-examples/minecraft-model/src/main/kotlin/org/apache/nlpcraft/example/MinecraftModel.kt b/nlpcraft-examples/minecraft-model/src/main/kotlin/org/apache/nlpcraft/example/MinecraftModel.kt
index a5b8c88..8e460e4 100644
--- a/nlpcraft-examples/minecraft-model/src/main/kotlin/org/apache/nlpcraft/example/MinecraftModel.kt
+++ b/nlpcraft-examples/minecraft-model/src/main/kotlin/org/apache/nlpcraft/example/MinecraftModel.kt
@@ -69,8 +69,9 @@ class MinecraftModel : NCModelFileAdapter("minecraft.yaml") {
     @NCIntentSample(
         "give me iron sword",
         "give me 10 grass blocks",
-        "give PlayerName a jigsaw",
-        "give PlayerName 1 kilogram of feathers"
+        "give #PlayerName a jigsaw",
+        "give #PlayerName 1 kilogram of feathers",
+        "give potion to me"
     )
     fun onGiveMatch(
         ctx: NCIntentMatch,
@@ -95,7 +96,7 @@ class MinecraftModel : NCModelFileAdapter("minecraft.yaml") {
         "make a cube of gold near me",
         "make a line of grass with length of 2 near me",
 
-        "create a rectangle of dirt in front of PlayerName",
+        "create a rectangle of dirt in front of #PlayerName",
         "make a box of sand with the size of 2 10 meters in front of me"
     )
     fun onFillMatch(
diff --git a/nlpcraft-examples/minecraft-model/src/main/resources/minecraft.yaml b/nlpcraft-examples/minecraft-model/src/main/resources/minecraft.yaml
index 2a5252d..b61832f 100644
--- a/nlpcraft-examples/minecraft-model/src/main/resources/minecraft.yaml
+++ b/nlpcraft-examples/minecraft-model/src/main/resources/minecraft.yaml
@@ -24,16 +24,15 @@ description: Minecraft Model.
 ]
 
 macros:
-  - name: "<PLAYER_NAME>"
-    macro: "{me|I|my|//[a-zA-Z0-9]+//}"
-#  - name: "<PLAYER_NAME>"
-#    macro: "{me|I|my}"
+  - name: "<PLAYER_NICKNAME>"
+    macro: "{//[a-zA-Z0-9]+//}"
+
 
 elements:
   # General synonyms
   - id: mc:player
     synonyms:
-      - "<PLAYER_NAME>"
+      - "{I|me|my|#<PLAYER_NICKNAME>}"
   - id: mc:item
     metadata:
       mc:type: item
@@ -102,8 +101,6 @@ elements:
   - id: give:action
     synonyms:
       - "{give ^^[target]{tok_id() == 'mc:player'}^^}"
-    jiggleFactor: 0
-    permutateSynonyms: false
   - id: give:block-word
     synonyms:
       - "{block|blocks}"
@@ -133,16 +130,12 @@ elements:
       - fill:position
     synonyms:
       - "{{at|near} ^^[player]{tok_id() == 'mc:player'}^^ {position|_}|where ^^[player]{tok_id() == 'mc:player'}^^}"
-    jiggleFactor: 0
-    permutateSynonyms: false
 
   - id: position:front
     groups:
       - fill:position
     synonyms:
       - "{{^^[distance]{tok_id() == 'nlpcraft:num'}^^|_} {in|_} front {of|_} ^^[player]{tok_id() == 'mc:player'}^^}"
-    jiggleFactor: 0
-    permutateSynonyms: false
 
 # List of model intents.
 intents:

[incubator-nlpcraft] 01/02: NLPCRAFT-91: Fix for new IDL

Posted by if...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 214b38e712e758a8d496c71500132d0d8c2faae2
Author: Ifropc <if...@apache.org>
AuthorDate: Wed Mar 24 20:48:59 2021 -0700

    NLPCRAFT-91: Fix for new IDL
---
 .../src/main/resources/minecraft.yaml                | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/nlpcraft-examples/minecraft-model/src/main/resources/minecraft.yaml b/nlpcraft-examples/minecraft-model/src/main/resources/minecraft.yaml
index 9d21b4b..2a5252d 100644
--- a/nlpcraft-examples/minecraft-model/src/main/resources/minecraft.yaml
+++ b/nlpcraft-examples/minecraft-model/src/main/resources/minecraft.yaml
@@ -101,7 +101,7 @@ elements:
   # Give intent
   - id: give:action
     synonyms:
-      - "{give ^^[target](id == 'mc:player')^^}"
+      - "{give ^^[target]{tok_id() == 'mc:player'}^^}"
     jiggleFactor: 0
     permutateSynonyms: false
   - id: give:block-word
@@ -127,12 +127,12 @@ elements:
       - "wall"
   - id: fill:length
     synonyms:
-      - "{{size|length|diameter} {of|_} ^^[length](id == 'nlpcraft:num')^^}"
+      - "{{size|length|diameter} {of|_} ^^[length]{tok_id() == 'nlpcraft:num'}^^}"
   - id: position:player
     groups:
       - fill:position
     synonyms:
-      - "{{at|near} ^^[player](id == 'mc:player')^^ {position|_}|where ^^[player](id == 'mc:player')^^}"
+      - "{{at|near} ^^[player]{tok_id() == 'mc:player'}^^ {position|_}|where ^^[player]{tok_id() == 'mc:player'}^^}"
     jiggleFactor: 0
     permutateSynonyms: false
 
@@ -140,18 +140,18 @@ elements:
     groups:
       - fill:position
     synonyms:
-      - "{{^^[distance](id == 'nlpcraft:num')^^|_} {in|_} front {of|_} ^^[player](id == 'mc:player')^^}"
+      - "{{^^[distance]{tok_id() == 'nlpcraft:num'}^^|_} {in|_} front {of|_} ^^[player]{tok_id() == 'mc:player'}^^}"
     jiggleFactor: 0
     permutateSynonyms: false
 
 # List of model intents.
 intents:
-  - intent=weatherIntent term={id == 'weather:action'}? term(arg)={groups @@ 'weather'}
-  - intent=timeIntent term(arg)={groups @@ 'time'}
-  - "intent=giveIntent term(action)={id == 'give:action'} term(quantity)={id == 'nlpcraft:num'}?
-  term(item)={id == 'mc:item'} term={id == 'give:block-word'}?"
-  - "intent=fillIntent term={id == 'fill:action'} term(shape)={groups @@ 'fill:shape'} term(block)={id == 'mc:item'}
-  term(len)={id == 'fill:length'}? term(position)={groups @@ 'fill:position'}"
+  - intent=weatherIntent term={tok_id() == 'weather:action'}? term(arg)={has(tok_groups(), 'weather')}
+  - intent=timeIntent term(arg)={has(tok_groups(), 'time')}
+  - "intent=giveIntent term(action)={tok_id() == 'give:action'} term(quantity)={tok_id() == 'nlpcraft:num'}?
+  term(item)={tok_id() == 'mc:item'} term={tok_id() == 'give:block-word'}?"
+  - "intent=fillIntent term={tok_id() == 'fill:action'} term(shape)={has(tok_groups(), 'fill:shape')} term(block)={tok_id() == 'mc:item'}
+  term(len)={tok_id() == 'fill:length'}? term(position)={has(tok_groups(), 'fill:position')}"
 
 # give me sand
 swearWordsAllowed: true