...
isCurrentTopic(var)
: returns true if the provided string or variable containing a string matches one of the topics of the sub-dialogue currently active.known(expr)
: this returns true of the provided expression evaluates to anything but the NULL value.isLastNonNullTopic(var)
: similar toisCurrentTopic
but executes the match on the last non null topic. That is, if currently there are no active networks, this will match the value of var with the topic of the last active network.isQuestion(var)
: returns true if the provided var evaluates to a string that contains the string "question". This maps to the methodedu.usc.ict.nl.io.NLU.isQuestion
overwrite with your own specific NLU class if you want to customize or write a new custom function.match(var1,var2)
: maps to the String.matches(regexp) Java method. var1 must be a string or evaluate to one. var2 must be a string or evaluate to one. The content of var2 must be a valid Java regular expression.random(var)
: generates a random number from 0 to the value invar
-1.var
doesn't have to be a variable but can also be a numeric constant.follows(var1,var2)
: var1 is a string constant (or a variable with a string constant as value) and var2 is a boolean (or a variable with a boolean value). Var2 is optional, by default it's false. The function returns true if the operator named by var1 has already been executed. If var2 is true, then the function returns true only if the operator named by var1 has already been completed (that is, any final state in the operator has been executed (as opposed to being swapped out before completion)).
- Hash functions:
- newMap
- clear
- get
- set
- List functions:
- exists
- intersect
- len
- removeIf
- removeIfNot
- subtract
- union
- String functions:
match(var1,var2)
: maps to the String.matches(regexp) Java method. var1 must be a string or evaluate to one. var2 must be a string or evaluate to one. The content of var2 must be a valid Java regular expression.- concatenate
- Time functions:
- currentTime
- getLastTimeMark
- Ordering:
follows(var1,var2)
: var1 is a string constant (or a variable with a string constant as value) and var2 is a boolean (or a variable with a boolean value). Var2 is optional, by default it's false. The function returns true if the operator named by var1 has already been executed. If var2 is true, then the function returns true only if the operator named by var1 has already been completed (that is, any final state in the operator has been executed (as opposed to being swapped out before completion)).
- Topic:
isCurrentTopic(var)
: returns true if the provided string or variable containing a string matches one of the topics of the sub-dialogue currently active.isLastNonNullTopic(var)
: similar toisCurrentTopic
but executes the match on the last non null topic. That is, if currently there are no active networks, this will match the value of var with the topic of the last active network.
- Numbers:
- min
random(var)
: generates a random number from 0 to the value invar
-1.var
doesn't have to be a variable but can also be a numeric constant.- round
- Debug:
- trace
- Other:
- if
known(expr)
: this returns true of the provided expression evaluates to anything but the NULL value.- numToString
- hasBeenInterrupted
- isInterruptible
Quotation
Delayed evaluation is available using the special operator quote
. For example, if we execute this assignment assign(expr1,quote(+(var1,var2,3)))
we save in the variable expr1
the expression that computes the sum of var1
, var2
and the constant 3
. every time we use the variable expr1
it's like if we use the entire expression it contains. If we later write the condition >=(expr1,34)
it's equivalent to the condition >=(+(var1,var2,3),34)
.
...