Named Entity Recognition 25.4
Named Entity Recognition User and Programming Guide

# Example Grammar File to Match Months

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE grammars SYSTEM "../published/edk.dtd">

    <grammars version="4.0">
       <include path="winter_names.ecr" type="private"/>
       <grammar name="example">

          <entity name="spring_month" type="private">
             <pattern>[Mm]ar(ch|\.)</pattern>
             <entry headword="April"/>
             <entry headword="april"/>
             <entry headword="Apr"/>
             <entry headword="apr"/>
             <entry headword="Apr."/>
             <entry headword="apr."/>
             <pattern replace="May">[Mm]ay\.?</pattern>
             <entry headword="June">
                <synonym>Jun</synonym>
                <synonym>Jun.</synonym>
                <synonym>june</synonym>
                <synonym>jun</synonym>
                <synonym>jun.</synonym>
             </entry>
          </entity>

          <entity name="summer_month" type="private" case="insensitive">
             <entry headword="June"/>
             <entry headword="July"/>
             <entry headword="August"/>
             <entry headword="September"/>
          </entity>

          <entity name="month" type="public">
             <pattern>(?A^spring_month)</pattern>
             <pattern>(?A:summer_month)</pattern>
             <entry headword="September"/>
             <entry headword="October"/>
             <entry headword="November"/>
             <entry headword="December"/>
             <pattern>(?A^winter_month)</pattern>
             <!-- spelling mistakes -->
             <entry score="0.5" headword="Febuary"/>
          </entity>

       </grammar>
    </grammars>

Copyright 2013-2025 Open Text
Version 25.4 | Last updated October 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.4

Topic Title: Example Grammar File to Match Months