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 <[email protected]> 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:
