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/01/15 00:39:15 UTC
[incubator-nlpcraft] branch master updated: Update
LightSwitchKotlinModel.kt
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 f55c257 Update LightSwitchKotlinModel.kt
f55c257 is described below
commit f55c257cf741da3a612b09b4e2d848af89c85770
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Thu Jan 14 16:39:01 2021 -0800
Update LightSwitchKotlinModel.kt
---
.../nlpcraft/examples/lightswitch/LightSwitchKotlinModel.kt | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchKotlinModel.kt b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchKotlinModel.kt
index 57c02bc..18862f9 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchKotlinModel.kt
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchKotlinModel.kt
@@ -17,12 +17,7 @@
package org.apache.nlpcraft.examples.lightswitch
-import org.apache.nlpcraft.model.NCModelFileAdapter
-import org.apache.nlpcraft.model.NCIntentRef
-import org.apache.nlpcraft.model.NCIntentSample
-import org.apache.nlpcraft.model.NCIntentTerm
-import org.apache.nlpcraft.model.NCToken
-import org.apache.nlpcraft.model.NCResult
+import org.apache.nlpcraft.model.*
import java.util.stream.Collectors
/**
@@ -69,7 +64,7 @@ class LightSwitchKotlinModel : NCModelFileAdapter("org/apache/nlpcraft/examples/
): NCResult {
val status = if (actTok.id == "ls:on") "on" else "off"
val locations = if (locToks.isEmpty()) "entire house" else locToks.stream()
- .map { t: NCToken -> t.meta<Any>("nlpcraft:nlp:origtext") as String }
+ .map { t: NCToken -> t.meta("nlpcraft:nlp:origtext") as String }
.collect(Collectors.joining(", "))
// Add HomeKit, Arduino or other integration here.