This site is no longer updated.Go to new Conversational Cloud docs

$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.ru", 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.ru phrase, with all the hypotheses returned:

{
   "text":"text@entities.ru",
   "entities":{
      "default":true,
      "entity":"duckling.email",              // entity found
      "startPos":0,                           // word position in the phrase
      "endPos":16,
      "text":"text@entities.ru",
      "value":"text@entities.ru",
      "system":true
   }
}

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.ru", true)));