You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nlpcraft.apache.org by "Aaron Radzinski (Jira)" <ji...@apache.org> on 2021/03/23 02:58:00 UTC
[jira] [Comment Edited] (NLPCRAFT-281) Add term-scoped variables to
IDL.
[ https://issues.apache.org/jira/browse/NLPCRAFT-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17306711#comment-17306711 ]
Aaron Radzinski edited comment on NLPCRAFT-281 at 3/23/21, 2:57 AM:
--------------------------------------------------------------------
Term-scoped variables have been added. Here's the snippet of usage:
{{ intent=i2
flow="a[^0-9]b"
meta={'a': 42, 'b': {'Москва': [1, 2, 3]}}
term(t1)={2 == 2 && !(id()) != -25 && meta_model('a') == 42}
term(t2)={
@a = meta_model('a')
@list = list(1, 2, 3, 4)
@a == 42 && has_all(@list, list(3, 2))
}
intent=i3
flow="a[^0-9]b"
term(t1)={
@x = 2
@xx = ((@x * @x) / 2) * 3
@xx == 6 && has(
json(meta_req('user_json_payload')),
list("موسكو\"", 'v1\'v1', "k2", "v2")
)
}}}
was (Author: aradzinski):
Term-scoped variables have been added. Here's the snippet of usage:
{color:#0f9795}intent{color}=i2
{color:#0f9795}flow{color}={color:#9fd356}"a[^0-9]b"
{color} {color:#0f9795}meta{color}={{color:#9fd356}'a'{color}: {color:#3c91e6}42{color}, {color:#9fd356}'b'{color}: {{color:#9fd356}'Москва'{color}: [{color:#3c91e6}1{color}, {color:#3c91e6}2{color}, {color:#3c91e6}3{color}]}}
{color:#0f9795}term{color}(t1)={{color:#3c91e6}2 {color}== {color:#3c91e6}2 {color}&& !({color:#fa824c}id{color}()) != -{color:#3c91e6}25 {color}&& {color:#fa824c}meta_model{color}({color:#9fd356}'a'{color}) == {color:#3c91e6}42{color}}
{color:#0f9795}term{color}(t2)={
@a = {color:#fa824c}meta_model{color}({color:#9fd356}'a'{color})
@{color:#fa824c}list {color}= {color:#fa824c}list{color}({color:#3c91e6}1{color}, {color:#3c91e6}2{color}, {color:#3c91e6}3{color}, {color:#3c91e6}4{color})
@a == {color:#3c91e6}42 {color}&& has_all(@{color:#fa824c}list{color}, {color:#fa824c}list{color}({color:#3c91e6}3{color}, {color:#3c91e6}2{color}))
}
{color:#0f9795}intent{color}=i3
{color:#0f9795}flow{color}={color:#9fd356}"a[^0-9]b"
{color} {color:#0f9795}term{color}(t1)={
@x = {color:#3c91e6}2
{color} @xx = ((@x * @x) / {color:#3c91e6}2{color}) * {color:#3c91e6}3
{color}{color:#3c91e6}
{color} @xx == {color:#3c91e6}6 {color}&& {color:#fa824c}has{color}(
{color:#fa824c}json{color}({color:#fa824c}meta_req{color}({color:#9fd356}'user_json_payload'{color})),
{color:#fa824c}list{color}({color:#9fd356}"{color}{color:#9fd356}موسكو{color}\"{color:#9fd356}"{color}, {color:#9fd356}'v1{color}\'{color:#9fd356}v1'{color}, {color:#9fd356}"k2"{color}, {color:#9fd356}"v2"{color})
)
}
> Add term-scoped variables to IDL.
> ---------------------------------
>
> Key: NLPCRAFT-281
> URL: https://issues.apache.org/jira/browse/NLPCRAFT-281
> Project: NLPCraft
> Issue Type: Task
> Components: model
> Reporter: Aaron Radzinski
> Assignee: Aaron Radzinski
> Priority: Major
> Fix For: 0.7.5
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)