$caila.entitiesLookup
Searches for entities in the argument text.
Syntax
The method accepts the text for parsing in the string
argument and the show all
flag. If the flag is:
true
— all the hypotheses found are returned in the response.false
— the most probable hypothesis is returned.
- ECMAScript 5
- ECMAScript 6
$caila.entitiesLookup("text@entities.com", true);
In the ECMAScript 6 runtime, the method is asynchronous:
await $caila.entitiesLookup("text@entities.com", true);
A JSON object with the entities found in the phrase is returned in response. The result of search for entities in the text@entities.com
phrase, with all the hypotheses returned:
{
"text":"text@entities.com",
"entities":{
"default":true,
"entity":"duckling.email", // entity found
"startPos":0, // word position in the phrase
"endPos":16,
"text":"text@entities.com",
"value":"text@entities.com",
"system":true
}
}
tip
You can also use the custom
clientId
identifier as a method argument. Specify the clientId
identifier as the last argument. When $caila.entitiesLookup()
is executed, entities will be recognized for the specified client.How to use
- ECMAScript 5
- ECMAScript 6
state: Example
q!: entitiesLookup
script:
$reactions.answer(JSON.stringify($caila.entitiesLookup("test@test.com", true)));
state: Example
q!: entitiesLookup
scriptEs6:
$reactions.answer(JSON.stringify(await $caila.entitiesLookup("test@test.com", true)));