Named Entity Recognition 25.2
Named Entity Recognition User and Programming Guide

# grammar.xml

    <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE grammars SYSTEM "../published/edk.dtd">
    <!-- Sample Named Entity Recognition grammar file showing all elements and attributes in the DTD -->
    <grammars debug="true" case="sensitive">
      <include path="grammar_include.xml" type="private">
        <publish name="grammar2/g2e2"/>  <!-- publish previously private entity -->
      </include>
      <grammar name="grammar1" case="inherited" extend="disallow" debug="inherited">
        <extern name="grammar2"/> <!-- removes the need to refer explicitly to grammar2 -->
        <entity name="entity1" type="public" case="insensitive" extend="disallow" debug="true">
        <!-- the following entity definitions are not useful but are provided only to illustrate the options and combinations of elements and attributes available -->
        <pattern score=".1" case="insensitive" replace="replacechars" insert_before="prefix_" insert_after="_suffix">cat</pattern>
        <pattern score=".2">sat</pattern>
        <entry headword="mat" score=".3" case="inherited" debug="inherited">
          <synonym case="inherited">rug</synonym> <!-- will locate rug but return mat -->
          <!-- will locate rug but return mat -->
          <synonym case="inherited"><![CDATA[carpet]]></synonym> <!-- illustrates allowing CDATA in this element -->
          </entry>
          <entry headword="dog" score=".6"/>
          <entry>
            <headword score=".8"><![CDATA[rabbit<hi!>&abc&amp;]]></headword>
            <synonym>bunny</synonym>
          </entry>
        </entity>
        <entity name="entity2" type="public">
          <pattern>(?A:g2e1)</pattern>
        </entity>
      </grammar>
    </grammars>

Copyright 2013-2025 Open Text
Version 25.2 | Last updated April 2025

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 25.2

Topic Title: grammar.xml