Skip to main content


Checks every word from the argument array for belonging to the vocabulary of the specified NLU engine.


The method accepts an array of objects with the following properties:

KeyDescriptionAllowed valuesDefault value
wordThe word to be checked.An arbitrary string.
langThe language that the word belongs to.en — English.
ru — Russian.
The project NLU language.
engineThe engine that will perform the check.aot — the engine based on the АОТ service.
pymorphy — the engine based on the pymorphy2 library.
The pymorphy engine does not support English.
{word: "technology", lang: "en"},
{word: "технология", lang: "ru", engine: "pymorphy"},
{word: "zxcvbnm,./"}
]); // => [true, true, false]

How to use

An example use of this method is to check whether unrecognized user requests contain at least one vocabulary word. If they don’t, such requests may be treated as spam.

state: CatchAll
event!: noMatch
# $parseTree.words is an array of all words contained within the request.
# Convert them from strings to objects having the required format.
var words = $ {
return {word: string};

# Check each word whether it belongs to the language vocabulary.
var wordsInVocab = $caila.checkVocabulary(words);

# Increment the counter of unrecognized requests
# only if at least one word was found in the vocabulary.
if (wordsInVocab.indexOf(true) > -1) {
$session.catchAllCounter = $session.catchAllCounter + 1 || 1;
# Transfer to the agent when the counter exceeds the threshold.
if: $session.catchAllCounter > 3
go!: /Switch
a: I’m sorry, I didn’t catch that. Could you repeat, please?
a: I didn’t quite get it. Would you mind repeating that for me?
a: Could you say that again? I can’t hear you very well.