Named Entity Recognition 26.3
Named Entity Recognition User and Programming Guide

# <grammar>

Element: grammar

Child Elements: <extern>, <entity>

Description: Defines a grammar, which is a collection of entities. You use entities for matching.

Example: `<grammar name="grammar1" case="inherited" extend="disallow" debug="inherited">`

Attribute | Value | Default | Description
--- | --- | --- | ---
`name` | <grammar name> |  | The name of the grammar. A value is required. NOTE: The full name of an entity is the name attribute of the parent grammar, followed by a slash, and then the entity name attribute. For example `mygrammar/name`. In general, the full name of an entity must be unique, even for entities in different grammar files. This restriction includes private entities that you might reference internally in a grammar. In some cases, non-unique entity names can cause unexpected results when you use multiple grammar files in the same Named Entity Recognition session. You can ensure that entity names are unique by making sure that the `<grammar>` tag in every source file has a unique value for the name attribute. An exception to this restriction is when you deliberately extend or replace an existing public entity.
`case` | sensitive insensitive inherited | inherited | Determines whether a match is case sensitive. The value `inherited` accepts the case matching mode of the <grammars> parent.
`extend` | append replace disallow | disallow | The mode to use for updating a grammar. Set this option to append to add the new entities to the existing grammar definition. Set it to replace to ignore the existing definition and use the new one. Set `extend` to disallow to prevent the new definition adding to or replacing values if there is already a grammar with the same name.
`debug` | true false inherited | inherited | Displays verbose information for the dictionary element during compilation. The value `inherited` accepts the debug mode of the `grammars` parent.

Copyright 2013-2026 Open Text
Version 26.3 | Last updated July 2026

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery Named Entity Recognition 26.3

Topic Title: <grammar>