Skip to main content

$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.
$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

    state:
q!: entitiesLookup
script:
$reactions.answer(JSON.stringify($caila.entitiesLookup("test@test.com", true)));