edu.northwestern.at.morphadorner.corpuslinguistics.lexicon

## Class BrillLexicon

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap<java.lang.String,java.util.List<java.lang.String>>
    - - edu.northwestern.at.morphadorner.corpuslinguistics.lexicon.BrillLexicon

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.util.List<java.lang.String>>

      public class BrillLexicon
      extends java.util.HashMap<java.lang.String,java.util.List<java.lang.String>>

  Brill format lexicon.

  A Brill lexicon is a `HashMap` that maps from a lexical entry (`String`) to possible POS categories (`List`.

  A Brill lexicon is a simple utf-8 formatted text file containing words and their possible part of speech tags. Each word appears on a separate line. The first token on each line is the word. The remaining tokens are the potential parts of speech for the word, separated by blanks or tab characters. The most commonly occurring part of speech should be the first one listed.

  `word pos1 pos2 pos3 ...`

  This type of lexicon format was popularized by Eric Brill's part of speech tagger in the early 1990s.

  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BrillLexicon(java.net.URL lexiconURL, java.lang.String encoding)` Create a Brill lexicon.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `saveToFile(java.lang.String fileName, java.lang.String encoding)` Save Brill lexicon to a file.

    - ### Methods inherited from class java.util.HashMap

      `clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values`

    - ### Methods inherited from class java.util.AbstractMap

      `equals, hashCode, toString`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `equals, hashCode`

- - ### Constructor Detail

    - #### BrillLexicon

          public BrillLexicon(java.net.URL lexiconURL,
                      java.lang.String encoding)
                       throws java.io.IOException

      Create a Brill lexicon.
      Parameters:
        `lexiconURL` - URL for the file containing the lexicon.
        `encoding` - Character encoding of lexicon file text.
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### saveToFile

          public void saveToFile(java.lang.String fileName,
                        java.lang.String encoding)
                          throws java.io.IOException

      Save Brill lexicon to a file.
      Parameters:
        `fileName` - File name to which to save the Brill lexicon.
        `encoding` - The file encoding (usually utf-8).
      Throws:
        `java.io.IOException`