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-website.git
The following commit(s) were added to refs/heads/master by this push:
new f474ae6 WIP.
f474ae6 is described below
commit f474ae63444ea6ed70c84d8d102974105c91539e
Author: Aaron Radzinski <[email protected]>
AuthorDate: Sat Mar 27 20:54:35 2021 -0700
WIP.
---
blogs/quick_intro_apache_nlpcraft.html | 2 +-
examples/alarm_clock.html | 3 ++-
examples/light_switch.html | 2 +-
examples/weather_bot.html | 8 ++++----
first-example.html | 2 +-
intent-matching.html | 12 ++++++------
6 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/blogs/quick_intro_apache_nlpcraft.html
b/blogs/quick_intro_apache_nlpcraft.html
index 4c62a0e..6071a48 100644
--- a/blogs/quick_intro_apache_nlpcraft.html
+++ b/blogs/quick_intro_apache_nlpcraft.html
@@ -229,7 +229,7 @@ publish_date: November 16, 2020
- "{<ACTION>|shut|kill|stop|eliminate} {off|out}
<LIGHT>"
- "no <LIGHT>"
intents:
- - "intent=ls term(act)={groups @@ 'act'} term(loc)={id == 'ls:loc'}*"
+ - "intent=ls term(act)={has(tok_groups(), 'act')}
term(loc)={tok_id() == 'ls:loc'}*"
</pre>
<p><b>NOTES:</b></p>
<ul>
diff --git a/examples/alarm_clock.html b/examples/alarm_clock.html
index b69f7c9..ab4c1dd 100644
--- a/examples/alarm_clock.html
+++ b/examples/alarm_clock.html
@@ -301,7 +301,8 @@ public class AlarmClock extends NCModelFileAdapter {
</p>
<ul>
<li>
- <i style="color: #F39C12" class="fa
fa-exclamation-triangle"></i> REST server is a "fire-and-forget" component that
you generally needs to start only once.
+ <i style="color: #F39C12" class="fa
fa-exclamation-triangle"></i> REST server is a "fire-and-forget" component that
you generally needs to start only once for this and any other
+ examples.
</li>
<li>
Run <code class="script">bin/nlpcraft.sh help
--cmd=start-server</code> to get a full help on this command.
diff --git a/examples/light_switch.html b/examples/light_switch.html
index 5b986a5..39d6221 100644
--- a/examples/light_switch.html
+++ b/examples/light_switch.html
@@ -123,7 +123,7 @@ elements:
- "{<ACTION>|shut|kill|stop|eliminate} {off|out} <LIGHT>"
- "no <LIGHT>"
intents:
- - "intent=ls term(act)={groups @@ 'act'} term(loc)={id == 'ls:loc'}*"
+ - "intent=ls term(act)={has(tok_groups(), 'act')} term(loc)={tok_id() ==
'ls:loc'}*"
</pre>
<p>There are number of important points here:</p>
<ul>
diff --git a/examples/weather_bot.html b/examples/weather_bot.html
index 4a9c8ea..9d711d0 100644
--- a/examples/weather_bot.html
+++ b/examples/weather_bot.html
@@ -245,10 +245,10 @@ public class Weather extends NCModelFileAdapter {
@NCIntent(
"intent=req " +
- "term~{id == 'wt:phen'}+ " + // One or more weather phenomenon (at
least is mandatory).
- "term(ind)~{groups @@ 'indicator'}* " + // Optional indicator words
(zero or more).
- "term(city)~{id == 'nlpcraft:city'}? " + // Optional city.
- "term(date)~{id == 'nlpcraft:date'}?" // Optional date (overrides
indicator words).
+ "term~{tok_id() == 'wt:phen'}+ " + // One or more weather phenomenon
(at least is mandatory).
+ "term(ind)~{has(tok_groups(), 'indicator')}* " + // Optional indicator
words (zero or more).
+ "term(city)~{tok_id() == 'nlpcraft:city'}? " + // Optional city.
+ "term(date)~{tok_id() == 'nlpcraft:date'}?" // Optional date
(overrides indicator words).
)
@NCIntentSample({
"What's the local weather forecast?",
diff --git a/first-example.html b/first-example.html
index cb34544..4b6a023 100644
--- a/first-example.html
+++ b/first-example.html
@@ -131,7 +131,7 @@ id: first_example
- "<LIGHT> <KILL>"
- "no <LIGHT>"
intents:
- - "intent=ls term(act)={groups @@ 'act'} term(loc)={id ==
'ls:loc'}*"
+ - "intent=ls term(act)={has(tok_groups(), 'act')}
term(loc)={tok_id() == 'ls:loc'}*"
</pre>
<p>
Notice three model elements at lines 16, 23, and 31:
diff --git a/intent-matching.html b/intent-matching.html
index 6d05444..b90b4d2 100644
--- a/intent-matching.html
+++ b/intent-matching.html
@@ -546,7 +546,7 @@ id: intent_matching
For example:
</p>
<pre class="brush: java">
- @NCIntent("intent=id term(termId)~{id == 'my_token'}?")
+ @NCIntent("intent=id term(termId)~{tok_id() == 'my_token'}?")
private NCResult onMatch(
@NCIntentTerm("termId") Optional<NCToken> myTok
) {
@@ -742,8 +742,8 @@ id: intent_matching
</p>
<pre class="brush: js">
intent=id1
- term~{id == 'x:id'}
- term(nums)~{id == 'nlpcraft:num' &&
lowercase(~nlpcraft:num:unittype) == 'datetime'}[0,2]
+ term~{tok_id() == 'x:id'}
+ term(nums)~{tok_id() == 'nlpcraft:num' &&
lowercase(meta_tok('nlpcraft:num:unittype')) == 'datetime'}[0,2]
</pre>
<p><b>NOTES:</b></p>
<ul>
@@ -754,7 +754,7 @@ id: intent_matching
Intent uses default conversational support (<code>true</code>)
and default order (<code>false</code>).
</li>
<li>
- Intent has two converstaional terms that have to be found for
the intent to match. Note that second term is optional as it
+ Intent has two conversational terms that have to be found for
the intent to match. Note that second term is optional as it
has <code>[0,2]</code> quantifier.
</li>
<li>
@@ -784,8 +784,8 @@ id: intent_matching
<pre class="brush: js">
intent=id2
flow='id1 id2'
- term={id == 'mytok' && signum(~score['best']) != -1}
- term={(groups @@ 'actors' || groups @@ 'owners') &&
size(partAlias.~text) > 10}
+ term={tok_id() == 'mytok' && signum(get(meta_tok('score'),
'best')) != -1}
+ term={has_all(tok_groups(), list('actors', 'owners')) &&
size(meta_part('partAlias, 'text')) > 10}
</pre>
<p><b>NOTES:</b></p>
<ul>