Class: NlgManager

NlgManager()

Natural Language Generator Manger

Constructor

new NlgManager()

Constructor of the class
Source:

Methods

addAnswer(locale, intent, answer, condition)

Adds an answer for a locale and intent.
Parameters:
Name Type Description
locale String Locale of the intent.
intent String Intent name.
answer String Text of the answer.
condition String Condition to be evaluated.
Source:

findAllAnswers(locale, intent, context)

Find all valid answers for the given locale and intent.
Parameters:
Name Type Description
locale String Locale of the intent.
intent String Intent name.
context Object Context to evaluate conditions.
Source:

findAnswer(locale, intent, context)

Find one valid answers for the given locale and intent. If there are more than one valid answer, then return one of them at random.
Parameters:
Name Type Description
locale String Locale of the intent.
intent String Intent name.
context Object Context to evaluate conditions.
Source:

isValid(condition, context) → {boolean}

Evaluate the condition using the context, and return true if the condition is passed, false otherwise.
Parameters:
Name Type Description
condition String Condition to be evaluated.
context Object Context to use to validate the condition.
Source:
Returns:
True if the condition is passed, false otherwise.
Type
boolean

removeAnswer(locale, intent, answer, condition)

Remove and answer from a locale and intent.
Parameters:
Name Type Description
locale String Locale of the intent.
intent String Intent name.
answer String Text of the answer.
condition String Condition to be evaluated.
Source: