Teneo Developers

Syntax editor

Introduction

The Syntax editors can be found in, among others, Syntax Match Requirements, Language Objects and Listeners, and they provide the option to write syntax conditions using references to Language Objects and/or Entities, plain words or attaching scripts (predicate scripts and propagation scripts) or even references to annotations. The syntax language used is Teneo Linguistic Modeling Language; an introduction to this can be found here while an extended reference manual is available here.

The below sections summarize the functionalities available in the Syntax editor.

Auto-complete

The auto-complete functionality of the Syntax editor offers suggestions when starting to type a reference to the name of an Entity or the name/alias of a Language Object.
To use the auto-complete functionality, follow the below steps:

  • type % (percentage sign)
  • write the first letter(s) of the name/alias
  • 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 syntax condition.

Condition building assistant

The TLML Syntax condition building assistant suggests which Entities or Language Objects to use in order to capture words expected in the user input.
To use the assistant, follow the below steps:

  • type the letters/word to capture
  • select the letters/word
  • press Ctrl + space

A list of Entities and Language Objects containing the word or letter combination will be suggested to the user.

When writing more than one word, all the words need to be selected to get suggestions on all the words (when pressing Ctrl + Space).

In Teneo Studio Web, when adding Language Object and Entity Matches or After Matches, the initially displayed list of suggestions (before writing anything in the text field) contains a list of the 20 most recently added or modified Language Objects/Entities

Syntax highlighting

The Syntax editor provides support for syntax highlighting and the below table includes an overview of the available highlighting; also see the Troubleshooting TLML Syntax page for more information on specific syntax errors.

ColorUsed for...Example
Recognized Language ObjectRecognized Language ObjectsRecognized Language Objects
Recognized EntityRecognized EntityRecognized Entity
Variable names and operatorsVariable names and operatorsVariable names and operators
AnnotationsAnnotationsAnnotations
Color of commentsComments and quoted stringsThis is a comment
ScriptsScriptsScript
Missing parentheses or operatorsMissing parentheses or operatorsMissing parentheses or operators
Unrecognized objectUnrecognized Language Objects and EntitiesUnrecognized object
Disabled Language ObjectDisabled Language ObjectsDisabled Language Object
Disabled EntityDisabled EntitiesDisabled Entity
Parentheses matchingTeneo Studio Desktop onlyParentheses matching: Placing the cursor after a parenthesis will highlight the matching pair in pale green.Parentheses matching
NLU script valuesTeneo Studio Desktop onlyNLU script values are printed in orangeNLU Script values
NLU scriptsTeneo Studio Web onlyNLU scripts are printed in dark green

Unrecognized Language Objects or Entities

The below section currently only apply toTeneo Studio Desktop

When referring in the Syntax 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 from the Syntax editor, simply follow the below steps:

  • Double-click the name of the non-existing object, or single-click while holding the Alt key down
  • In the newly opened window, select the folder where the object should be created and 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's TLML syntax condition or the entries of the Entity, click Save when finished
  • Back in the original Syntax editor, the object is now printed in a greenish color (see above table).