Teneo Developers

Condition editor

Introduction

The Condition editor, available in Flows' Condition Match Requirements and similar to the editor of Language Objects, provides the option to write language conditions using Language Objects and Entities or even plain words.

The condition writing is done in Teneo's Linguistic Modelling Language, an introduction to this can be found here while an extended reference manual is available here. The Condition editor also allows to attach scripts (predicate scripts and propagation scripts) and to condition on annotations.

The Condition Editors

Auto-complete

The auto-complete functionality of the condition editor offers suggestions when typing a reference to an Entity name or Language Object name or alias.

To use the auto-complete functionality, type % (percentage sign) followed by the first letter(s) of the Language Object or Entity and then press Ctrl+space. A list of Entity and Language Object names beginning with the same set of letters will be displayed, and the user can choose any one of them to use in the condition.

Condition building assistant

The Condition building assistant suggests which Entities or Language Objects to use to capture specific words expected in the user input.

To use the assistant, type the word to capture in the condition editor, select it and press Ctrl+space. Next, a list of Language Objects and/or Entities containing that word will be suggested to the user.

When writing more than one word, the words needs to be selected before pressing Ctrl+space for the condition building assistant to suggest objects for all the selected words.

The Condition building assistant can be used in Match Requirements of the types Condition, Language Object, and Entity.

Advanced Options

When a user adds a Condition Match Requirement to an Intent Trigger or Transition, the below advanced options are available.

Draft condition

Only applicable for Condition Match Requirements

In a Condition Match Requirement is is possible to draft a condition based on the positive and negative examples written in the Trigger or Transition.

To draft a condition follow the below steps:

  • In the Match Requirement section of the Trigger or Transition, click Add
  • Select Condition from the menu
  • Expand the Advanced Options below the Condition editor
  • Click Draft Condition

Note that the Draft Condition button is disabled when the Trigger or Transition doesn't contain any positive examples.

If more positive or negative examples are added to the Trigger or Transition, the user can click Draft Condition again to get a new condition suggested.

Limit unused words to

This setting allows the user to define the number of words, besides those specified in the language condition, may be contained in the user input for that condition to be satisfied.

To define this advanced option, simply tick the Limit unused words to option and set the number of words that should be permitted.

Read more in the Knowledge Base

Unrecognized Language Objects or Entities

When referring in the Condition editor to a non-existing Language Object or Entity, the object will be printed in red and struck-through; it is possible to create the new object directly from the Condition editor, simply follow the below steps:

  • Double-click the name of the non-existing Language Object or Entity, or single-click while holding the Alt key down.
  • In the newly opened window, select the folder where the object should be created. Click OK.
  • Now, a new Language Object/Entity window opens, specify the Properties of the object. When done, click the green Play icon or the back arrow in the top left corner.
  • Add the Language Object condition or entries of the Entity and click Save when finished.
  • Back in the original Condition editor, the object will now be printed in a greenish color (see section below).

Syntax highlighting

The Condition editor, of both Condition Match Requirements and Language Objects, includes support for syntax highlighting.

ColorUsed for...Example
Recognized Language ObjectsRecognized Language Objects
Recognized EntityRecognized Entity
Variable names and operatorsVariable names and operators
AnnotationsAnnotations
Comments and quoted stringsThis is a comment
ScriptsScript
NLU script valuesNLU Script values
Parentheses matching: Placing the cursor after a parenthesis will highlight the matching pair in pale green.Parentheses matching
Missing parentheses or operatorsMissing parentheses or operators
Unrecognized Language Objects and EntitiesUnrecognized object
Disabled Language ObjectsDisabled Language Object
Disabled EntitiesDisabled Entity

Teneo Linguistic Modelling Language summary
TLML Condition Reference Manual
Scripts
Annotations