Entities are a special kind of language object. They cover words which have some characteristic in common. Each entity consists of one or more entries, which denote on what the entity is matching and optionally also which features are assigned to this entry.
Entities allow for three different kinds of entries:
Internally, a sequence of words will be tranformed into Teneo's condition syntax. For example, if the two words "Chai latte" are entered into the entry field of an entity, they will be interpreted as "Chai>>latte" which means that the word "Chai" is directly followed by the word "latte" without any intervening word allowed in between them. However this holds only for sequences of strings. For any other combination of entries, for example sequences containing entities or language objects this is not possible. If you want to add such a sequence (for example HOT.ADJ.LEX WATER.NN.LEX) to an entity you will have to create a new language object (here: HOT_WATER.ADJNN.MUL) which contains the sequence of these two language objects in its language condition. This multiword language object can then be added to be an entry of the entity BEVERAGES_SERVED.ENTITY.
Entity variables can be used to add properties to the different entries of an entity. There are two variable types: strings and scripts. The variable type can be determined using the toggle below the variable name. An example is given below. The customized entity BEVERAGES_SERVED.ENTITY contains all kinds of beverages served at Longberry Baristas. Its consist of
As you can see, a string variable can only contain strings, whereas a script variable can contain script expressions or strings. However, if you add strings to a script variable, make sure to add quotes around them.
In the example below we attached a propagation script to an entity in a listener condition. The flow variable orderedBeverage is assigned lob.beverageType. This lob is a special variable which points to the entity (or, more generally speaking the language object, hence lob) to which the script has been attached to, BEVERAGES_SERVED.ENTITY, and retrieves the value of the entity's variable beverageType.
So for example, if the user input is 'I want an Americano', then the value 'americano' will be assigned to the flow variable orderedBeverage.
What happens is the following:
Was this page helpful?