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/09/24 18:21:44 UTC
[incubator-nlpcraft] branch master updated: Basic cleanup on
Minecraft example.
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.git
The following commit(s) were added to refs/heads/master by this push:
new efd0c24 Basic cleanup on Minecraft example.
efd0c24 is described below
commit efd0c249962cefc5855b5c3dc676121aa2724ff3
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Fri Sep 24 11:21:33 2021 -0700
Basic cleanup on Minecraft example.
---
.../org/apache/nlpcraft/examples/minecraft/MinecraftModel.kt | 5 ++---
nlpcraft-examples/minecraft/src/main/resources/minecraft.yaml | 8 ++++----
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/nlpcraft-examples/minecraft/src/main/kotlin/org/apache/nlpcraft/examples/minecraft/MinecraftModel.kt b/nlpcraft-examples/minecraft/src/main/kotlin/org/apache/nlpcraft/examples/minecraft/MinecraftModel.kt
index de96e25..6137c5d 100644
--- a/nlpcraft-examples/minecraft/src/main/kotlin/org/apache/nlpcraft/examples/minecraft/MinecraftModel.kt
+++ b/nlpcraft-examples/minecraft/src/main/kotlin/org/apache/nlpcraft/examples/minecraft/MinecraftModel.kt
@@ -50,7 +50,7 @@ class MinecraftModel : NCModelFileAdapter("minecraft.yaml") {
"start a hurricane",
"cast super squall"
)
- fun onWeatherMatch(@Suppress("UNUSED_PARAMETER") ctx: NCIntentMatch, @NCIntentTerm("arg") tok: NCToken): NCResult {
+ fun onWeatherMatch(@NCIntentTerm("arg") tok: NCToken): NCResult {
return NCResult.text("weather ${tok.id}")
}
@@ -64,7 +64,7 @@ class MinecraftModel : NCModelFileAdapter("minecraft.yaml") {
"night",
"it's midnight"
)
- fun onTimeMatch(@Suppress("UNUSED_PARAMETER") ctx: NCIntentMatch, @NCIntentTerm("arg") tok: NCToken): NCResult {
+ fun onTimeMatch(@NCIntentTerm("arg") tok: NCToken): NCResult {
val time: Int = when (tok.id) {
"morning" -> 23000
"day" -> 1000
@@ -90,7 +90,6 @@ class MinecraftModel : NCModelFileAdapter("minecraft.yaml") {
"give potion to me"
)
fun onGiveMatch(
- @Suppress("UNUSED_PARAMETER") ctx: NCIntentMatch,
@NCIntentTerm("item") item: NCToken,
@NCIntentTerm("action") target: NCToken,
@NCIntentTerm("quantity") quantity: Optional<NCToken>
diff --git a/nlpcraft-examples/minecraft/src/main/resources/minecraft.yaml b/nlpcraft-examples/minecraft/src/main/resources/minecraft.yaml
index f786031..32b4632 100644
--- a/nlpcraft-examples/minecraft/src/main/resources/minecraft.yaml
+++ b/nlpcraft-examples/minecraft/src/main/resources/minecraft.yaml
@@ -100,7 +100,7 @@ elements:
# Give intent
- id: give:action
synonyms:
- - "{give ^^[target]{# == 'mc:player'}^^}"
+ - "{give ^^{# == 'mc:player'}^^}"
- id: give:block-word
synonyms:
- "{block|blocks}"
@@ -124,18 +124,18 @@ elements:
- "wall"
- id: fill:length
synonyms:
- - "{{size|length|diameter} {of|_} ^^[length]{# == 'nlpcraft:num'}^^}"
+ - "{{size|length|diameter} {of|_} ^^{# == 'nlpcraft:num'}^^}"
- id: position:player
groups:
- fill:position
synonyms:
- - "{{at|near} ^^[player]{# == 'mc:player'}^^ {position|_}|where ^^[player]{# == 'mc:player'}^^}"
+ - "{{at|near} ^^{# == 'mc:player'}^^ {position|_}|where ^^{# == 'mc:player'}^^}"
- id: position:front
groups:
- fill:position
synonyms:
- - "{{^^[distance]{# == 'nlpcraft:num'}^^|_} {in|_} front {of|_} ^^[player]{# == 'mc:player'}^^}"
+ - "{{^^{# == 'nlpcraft:num'}^^|_} {in|_} front {of|_} ^^{# == 'mc:player'}^^}"
abstractTokens:
- mc:player