Skip to main content

Language Objects

A Language Object is a reusable container for grouping words, sentences or other Language Objects, Entities, and Annotations. The scope of a Language Object can be as wide or narrow as needed, and it may contain a list of synonyms, figures of speech, idioms, thematically related words or simply the different conjugations of a verb or noun.

This section covers the following topics:

Concept

A Language Object is a reusable container for grouping words, sentences or other Language Objects, Entities, and Annotations. The scope of a Language Object can be as wide or narrow as needed, and it may contain a list of synonyms, figures of speech, idioms, thematically related words or simply the different conjugations of a verb or noun.

The simplest one-word Language Objects may look like this:

  • DOG.NN.LEX and cover the forms dog / dog's / dogs / dogs'
  • DOG.NN.SYN and cover the forms %DOG.NN.LEX / %HOUND.NN.LEX / %MUTT.NN.LEX / %POOCH.NN.LEX

Whereas a multi-word Language Object can look like this:

  • DOG.MUL and cover the following: %SMALL.ADJ.SYN + %DOG.NN.SYN

The syntax used is written in Teneo Linguistic Modeling Language (TLML). The different words or references must be separated by operators to indicate how they relate to each other. Furthermore, referenced Language Objects should be preceded by %.

info

Entities are a special kind of Language Object that cover a collection of related words or phrases. They cover a broader concept than a lexical Language Object.

Available Language Objects

From a solution, users have access to the following collections of Language Objects:

  • Language Object located in the solution, and
  • Language Objects available in any lexical resource assigned to the solution

Language Objects located in the solution are under full control of the Teneo Studio user and these can be managed and modified in any way; Language Objects from a lexical resource (e.g. Teneo Lexical Resources) can be viewed and used in TLML syntaxes but not modified.

Teneo Lexical Resources cover general language expressions and common phrases, but if domain-specific words are needed, the user can easily create missing Language Objects; see How to create to read more. Once created, the Language Objects can be used in the current solution and re-used in other solutions as well.

Naming Conventions

The Language Objects that come with the pre-built language resources follow a naming convention. When naming a Language Object, it is recommended to follow the naming conventions used by the Teneo Lexical Resources and the requisites below:

  • the name must be unique within the solution
  • the name is written in upper-case Lower cased characters are automatically upper cased by Teneo
  • the name cannot contain any reserved characters. Any special characters or blank spaces are automatically converted into underscore by Teneo
  • the name cannot end with .ENTITY

If a Language Object in the solution shares its name with a Language Object in an assigned lexical resource, the Language Object located in the solution is always chosen by Engine over the Language Object in the assigned lexical resource.

Types of Language Objects

An extensive table of the Language Object types, and part of speech tags used, can be found here.

Variables

NLU Variables can hold a specific value, like a string, Boolean, List, Map (key/value pair) or number. The name of a variable should be short, unique and meaningful, and written in camelCase; see naming conventions.

As an example, in the English Lexical Resource, the COUNTRY.ENTITY returns the variables sCountry, sCapital and sCountryCode, where all entries set a corresponding value, i.e. CANADA.NN.LEX sets the variable sCountry to Canada, the variable sCapital to Ottawa and the variable sCountryCode to CA.

warning

LO Variables are deprecated as of Teneo Platform 7.0 and users are encouraged to use NLU Variables instead.

Examples

The Examples added to Language Objects are used to generate the most optimal TLML Syntax in triggers and transitions when implementing TLML Match.

Read more about Examples here.

How To

Open

To open a Language Object in read only mode, either:

  • Double-click the wanted Language Object in the Solution Explorer view.
  • Select the Language Object and click Open in the top ribbon.
  • Right-click the Language Object and select Open in the context menu.
tip

In the Syntax editor, double-click the name to open a referenced Language Object in read only mode. In the Entries editor, left-click and select Open to open a referenced Language Object in read only mode.

note

Language Objects and Entities referenced from an assigned Lexical Resource always open in read-only mode.

Create

To create a new Language Object, simply follow these steps:

  1. Go to the Solution Explorer in the main Teneo Studio window (Home tab).
  2. Optionally select the folder, or create a new folder, where the Language Object should be added
  3. In the top ribbon, click on the Language Object button in the New area.
  4. The Language Object window opens on the Properties tab. Add the Name of the Language Object. Optionally, add an Alias and a Description.
  5. Click the green Play icon or the back arrow in the top left corner.
  6. Now, add the TLML syntax of the Language Object in the Syntax editor.
  7. Optionally, add NLU Variables, LO Variables and/or Examples (available in the right-hand side panels).
  8. Remember to Save to preserve all the modifications.
BULK IMPORT

Need to create several Language Objects (or Entities)? Consider using Bulk Import.

Edit

After opening the Language Object in edit mode, the user is able to work on the Language Object.

To open a Language Object in edit mode, either:

  • Activate edit in the opened Language Object by clicking Edit in the top ribbon of the Language Object.
  • Press the Alt key while double-clicking the wanted Language Object in the Solution Explorer view.
  • Select the Language Object and click Edit in the top ribbon.
  • Right-click the Language Object and select Edit in the context menu.
tip

Looking for tips on how to write the TLML Syntax or details about Variables? Check out the TLML Syntax editor or visit the section on how to add variablesfor more information on editing.

tip

In the Syntax editor, press Alt while clicking the referenced Language Object to open it in edit mode. In the Entries editor, left-click and select Edit to open referenced Language Object in edit mode.

Save

To save a Language Object with a comment follow these steps:

  1. Click Save in the top ribbon of the Language Object.
  2. In the dialogue box (optionally) write a comment.
  3. Click OK.

To save directly and bypass the comment, press the Alt key while clicking the Save button.

Close

To close a Language Object, either:

  • Click the X in the top, right corner of the Language Object window.
  • Click the Close button available in the top ribbon.
  • In the Language Object backstage, click Close in the left-side menu.

Should there be unsaved changes, Teneo Studio prompts the user to Save or Close without saving.

Delete

To delete a Language Object from the solution, follow these steps:

  1. Select the Language Object in the Solution Explorer.

  2. In the top ribbon of Teneo Studio, click Delete.

  3. A confirmation message will be displayed, click Delete again.

If the Language Object is in use, an Item in Use message will appear, click Select All to delete anyhow or Continue to cancel deletion (the user can also click the X in the box to cancel the deletion).

For more information, please see Delete documents.

Add Variable

warning

LO Variables are deprecated as of Teneo Platform 7.0 and users are encouraged to use NLU Variables instead.

To add a Variable to the Language Object, follow these steps:

  1. If not open, click NLU Variables or LO Variables in the right side of the window to open the panel.
  2. Under NLU Variables or LO Variables click Add.
  3. Write the Variable Name.
  4. Specify the Evaluation Script.
  5. Remember to Save the Language Object to preserve the changes.
note

_USED_WORDS allows you to return the words from the user input that matched the TLML syntax of the Language Object and implies that the value will be dynamically set to the matched word(s)

Delete Variable

To delete a Variable from the Language Object, follow these steps:

  1. In the Language Object window, expand the Variables tab in the right side of the view.
  2. Select the variable to delete and click Delete.
  3. Remember to Save the Language Object to preserve the changes.

UI

Language Object Window

This page provides an introduction to the Language Object window and the main options when working with Language Objects in Teneo Studio.

Language Object window

SectionDescriptionRelated Pages
Used by panelProvides information about where the Language Object is referenced; click any of the listed documents to navigate to it.
Top ribbonDisplays options for modifying Language Object.Top ribbon
Syntax editorAllows to write the TLML Syntax of the Language Object.Syntax editor
TLML Manual
NLU VariablesAllows to add NLU Variables to the Language Object.Add or Edit Variables
TLML
Variables
LO VariablesLanguage Object Variables are deprecated as of Teneo Platform 7.0 and users are encouraged to use NLU Variables insteadVariables
ExamplesAllows to write examples which the Language Object's scope should cover.Examples

Top ribbon

Furthermore, the Top ribbon offers the following options:

Language Object window

SectionDescriptionRelated Pages
Home tabOpens the syntax editor for a Language Object in the Language Object window.Language Object Window
Language Object tabOpens the Properties section for a Language Object in the backstage view.Backstage view
CloseClose the Language Object window.Close
SaveSave the Language Object in the current state; clicking the lower part of the button allows the user to save the Language Object with or without a comment.Save
Enable / DisableEnable or disable the Language Object.Enable of Disable documents
Undo / RedoUndo/redo changes performed in the Language Object.
Set / UnsetSet or unset the current version of the Language Object as stable.Version flag
Include / ExcludeInclude or exclude the Language Object from branching when working in a Localization setup.Localization setup

Backstage view

The backstage view of a Language Object can be accessed by selecting the Language Object tab.

Language Object window

BackstageDescriptionRelated Pages
SaveSave the Language Object in the current state; clicking the lower part of the button allows the user to save the Language Object with or without a comment.
PropertiesAllows to edit the name and alias of the Language Object, add a description or view the Id and location.
HistoryLists the history of versions created each time the Language Object was saved, comments added at save are displayed here Open a previous version by clicking the version number; restore a previous version by opening a specific version and clicking Restore in the top ribbon.Version history
MetadataAllows to define metadata values for the Language Object.Metadata
CloseClose the Language Object window.Close

Language Objects Overview

Language Objects can be defined in different folders within the solution.

final view

Practical Examples

Creating a Language Object

In this practical example, we will show you how to create Language Objects that define specific strings or reference other Language Objects. We will also walk you through creating an Entity that references several Language Objects.

This is what a simple Language Object may look like. It only covers the strings "decaf" and "decaffeinated".

simple language object desktop

However, to get more extensive coverage, you can use Language Objects within a Language Object. The following example would expressions such as "soy milk" and its synonyms, depending on the content of each Language Object declared.

complex LO

This is how you can create a Language Object like in the example above:

  1. Go to the folder where you would like to store your Language Objects. If desired, you can create a subfolder to store them in, for example, one called Milk alternatives.

  2. Click on Language Object in the 'New' section in the top ribbon bar.

  3. Call the Language Object SOY_MILK.MUL.

  4. Click on the back arrow in the top left to go to the main Language Object window and add the condition: %SOY.NN.LEX >> %MILK.NN.LEX.

  5. Save the Language Object.

note

The new Language Object consists of multiple words, and thus bears the suffix "MUL".

Using Language Objects in an Entity

Creating an Entity that uses the Language Objects can help to cover a broad concept. This is how you can create an Entity for different milk alternatives:

  1. In the main solution window, click on Entity in the 'New' in top ribbon bar. This will create a new Entity.
  2. Call the entity MILK_ALTERNATIVES (the suffix 'ENTITY' will be added automatically).
  3. Paste the following entries and select 'First row is variable names':
Entrydescription
%CONDENSED_MILK.MULcondensed milk
%LACTOSE_FREE_MILK.MULlactose free milk
%SOY_MILK.MULsoy milk
  1. Save the Entity.

We now have an Entity that recognizes the milk alternatives!

Tips and Tricks

Find Language Objects

This page will illustrate three ways of finding Language Objects and they all apply to Language Objects that come with Lexical Resources and the ones you have created yourself.

In Teneo, you can find Language Objects using:

  • The auto-complete function
  • Marking and searching
  • The search interface

Auto-complete Typing

If you already know that a certain Language Object exists and you (at least vaguely) remember its name, you can simply start typing the Language Object's name using TLML Syntax. Just remember that all language object names start with ''%''.

Once you have typed a few letters, press Ctrl + Space. This opens a drop-down menu that displays all available language objects (from both the Lexical Resources and your locally created ones) that start with the letters you have typed so far.

If the list of proposed Language Objects is too wide, simply continue typing the Language Object name and the list will narrow down. You can hover over each proposed Language Object in order to know what it covers without having to open it. This helps you to decide whether it is the right candidate for your current purpose.

Once you found the desired Language Object, simply click on it and it will be added to the condition.

This is how you use mark and search:

  1. Type one or more words using TLML Syntax.

  2. Mark the word(s) and press Ctrl + Space.

  3. Hover over the Language Objects in the result list to find the one that fits best.

  4. Select the desired Language Object from the result list.

This search strategy is similar to the first one, but it is more flexible and powerful:

  • You don't need to type '%'.
  • You can type more than one word (well suited to find more complex Language Objects like phrases).
  • What you type matches not only Language Object names but also the words the Language Objects cover.

The Search Interface

You can easily look for a specific Language Object in the search interface available in the top ribbon of your solution.

Read more about the search function here.