This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-383
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-383 by this push:
new 683451e WIP.
683451e is described below
commit 683451e561fd8fa1910eb8564a30ea078514527c
Author: Sergey Kamov <[email protected]>
AuthorDate: Wed Sep 8 13:30:26 2021 +0300
WIP.
---
.../solarsystem/intents/SolarSystemDiscoveryDate.scala | 12 ++++++------
...umConditions.scala => SolarSystemNumAggrConditions.scala} | 8 +++++---
.../solarsystem/intents/SolarSystemNumConditions.scala | 3 ++-
3 files changed, 13 insertions(+), 10 deletions(-)
diff --git
a/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemDiscoveryDate.scala
b/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemDiscoveryDate.scala
index bbbe5de..7fe1b96 100644
---
a/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemDiscoveryDate.scala
+++
b/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemDiscoveryDate.scala
@@ -37,12 +37,12 @@ class SolarSystemDiscoveryDate extends LazyLogging {
"intent=discoveryDate " +
" options={'unused_usr_toks': true}" +
" term(year)={" +
- " tok_id() == 'nlpcraft:num' && " +
- " (" +
- " meta_tok('nlpcraft:num:unit') == 'year' || " +
- " meta_tok('nlpcraft:num:from') >= 1610 &&
meta_tok('nlpcraft:num:from') <= year" +
- " )" +
- "}"
+ " tok_id() == 'nlpcraft:num' && " +
+ " (" +
+ " meta_tok('nlpcraft:num:unit') == 'year' || " +
+ " meta_tok('nlpcraft:num:from') >= 1610 &&
meta_tok('nlpcraft:num:from') <= year" +
+ " )" +
+ " }"
)
def date(@NCIntentTerm("year") year: NCToken): NCResult = {
// API doesn't support filter by dates.
diff --git
a/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemNumConditions.scala
b/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemNumAggrConditions.scala
similarity index 85%
copy from
nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemNumConditions.scala
copy to
nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemNumAggrConditions.scala
index 9ea6cf5..da57d74 100644
---
a/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemNumConditions.scala
+++
b/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemNumAggrConditions.scala
@@ -20,15 +20,17 @@ package org.apache.nlpcraft.examples.solarsystem.intents
import org.apache.nlpcraft.examples.solarsystem.api.SolarSystemOpenApiService
import org.apache.nlpcraft.model.{NCIntent, NCIntentSample, NCIntentTerm,
NCResult, NCToken}
-class SolarSystemNumConditions {
+class SolarSystemNumAggrConditions {
@NCIntentSample(
Array(
- "Planets with mass more 10",
+ "Planets with maximum mass",
+ "Planets with minimum radius"
)
)
@NCIntent(
"intent=aggregate " +
- " term(condition)={^^{tok_group == 'propNum'}^^ ^^{# ==
'nlpcraft:num' && meta_tok('nlpcraft:num:unit') == null}^^}"
+ " term(condition)={# == 'aggr'}" +
+ " term(num)={# == 'nlpcraft:num' && meta_tok('nlpcraft:num:unit')
== null}"
)
def discoverer(@NCIntentTerm("condition") cond: NCToken): NCResult = {
val s: String = cond.getMetadata.get("").asInstanceOf[String]
diff --git
a/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemNumConditions.scala
b/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemNumConditions.scala
index 9ea6cf5..30909ac 100644
---
a/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemNumConditions.scala
+++
b/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/intents/SolarSystemNumConditions.scala
@@ -28,7 +28,8 @@ class SolarSystemNumConditions {
)
@NCIntent(
"intent=aggregate " +
- " term(condition)={^^{tok_group == 'propNum'}^^ ^^{# ==
'nlpcraft:num' && meta_tok('nlpcraft:num:unit') == null}^^}"
+ " term(condition)={tok_group == 'propNum'}" +
+ " term(num)={# == 'nlpcraft:num' && meta_tok('nlpcraft:num:unit')
== null}"
)
def discoverer(@NCIntentTerm("condition") cond: NCToken): NCResult = {
val s: String = cond.getMetadata.get("").asInstanceOf[String]