edu.northwestern.at.morphadorner.corpuslinguistics.lexicon

## Class LexiconEntry

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.lexicon.LexiconEntry

- All Implemented Interfaces:
    XCloneable, java.io.Serializable, java.lang.Cloneable

      public class LexiconEntry
      extends java.lang.Object
      implements java.io.Serializable, XCloneable

  LexiconEntry: A lexicon entry.

  A LexiconEntry contains the following information about a particular spelling.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.util.Map<java.lang.String,MutableInteger>` | `categoriesAndCounts` Map with categories as keys and counts as values.
    `java.lang.String` | `entry` The lexicon entry string.
    `int` | `entryCount` The spelling count.
    `java.lang.String` | `largestCategory` Category with largest count.
    `int` | `largestCategoryCount` Count for largest category.
    `java.util.Map<java.lang.String,java.lang.String>` | `lemmata` Map with categories as keys and lemmatized entries as values.
    `java.lang.String` | `standardEntry` Standardized lexicon entry string.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LexiconEntry(java.lang.String entry, java.lang.String standardEntry, int entryCount, java.util.Map<java.lang.String,MutableInteger> categoriesAndCounts, java.util.Map<java.lang.String,java.lang.String> lemmata)` Create a LexiconEntry.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.util.Map<java.lang.String,MutableInteger>` | `categoriesAndCountsClone()` Deep clone of categories and counts map.
    `java.lang.Object` | `clone()` Clone this lexicon entry.
    `LexiconEntry` | `deepClone()` Deep clone of this lexicon entry.
    `void` | `determineLargestCategory()` Find the category with the largest count.
    `java.lang.String[]` | `getCategories()` Get the categories, sorted in ascending order.
    `int` | `getCategoryCount(java.lang.String category)` Get category count.
    `java.lang.String` | `getLemma(java.lang.String category)` Get lemma for a category.
    `java.lang.String[]` | `getLexiconEntryData()` Get String array containing lexicon data suitable for output.
    `protected java.util.Map<java.lang.String,java.lang.String>` | `lemmataClone()` Deep clone of lemmata map.
    `void` | `updateCategoryAndCount(java.lang.String category, int count)` Add or update entry in categories and counts map.
    `void` | `updateLemma(java.lang.String category, java.lang.String lemma)` Add/update lemma for a category.

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

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### entry

          public java.lang.String entry

      The lexicon entry string.

    - #### standardEntry

          public java.lang.String standardEntry

      Standardized lexicon entry string.

    - #### lemmata

          public java.util.Map<java.lang.String,java.lang.String> lemmata

      Map with categories as keys and lemmatized entries as values.

    - #### entryCount

          public int entryCount

      The spelling count.

    - #### categoriesAndCounts

          public java.util.Map<java.lang.String,MutableInteger> categoriesAndCounts

      Map with categories as keys and counts as values.

    - #### largestCategory

          public java.lang.String largestCategory

      Category with largest count.

    - #### largestCategoryCount

          public int largestCategoryCount

      Count for largest category.

  - ### Constructor Detail

    - #### LexiconEntry

          public LexiconEntry(java.lang.String entry,
                      java.lang.String standardEntry,
                      int entryCount,
                      java.util.Map<java.lang.String,MutableInteger> categoriesAndCounts,
                      java.util.Map<java.lang.String,java.lang.String> lemmata)

      Create a LexiconEntry.

  - ### Method Detail

    - #### determineLargestCategory

          public void determineLargestCategory()

      Find the category with the largest count.

    - #### updateCategoryAndCount

          public void updateCategoryAndCount(java.lang.String category,
                                    int count)

      Add or update entry in categories and counts map.
      Parameters:
        `category` - Category for which to add/update count.
        `count` - Category count to add to entry. May be negative.

    - #### getCategoryCount

          public int getCategoryCount(java.lang.String category)

      Get category count.
      Parameters:
        `category` - Get number of times category appears in this lexicon entry..
      Returns:
        Category count.

    - #### getCategories

          public java.lang.String[] getCategories()

      Get the categories, sorted in ascending order.
      Returns:
        The sorted category strings as an array of string.

    - #### updateLemma

          public void updateLemma(java.lang.String category,
                         java.lang.String lemma)

      Add/update lemma for a category.
      Parameters:
        `category` - Category for which to add lemma.
        `lemma` - Lemma.

    - #### getLemma

          public java.lang.String getLemma(java.lang.String category)

      Get lemma for a category.
      Parameters:
        `category` - Category for which to add lemma.
      Returns:
        The lemma.

    - #### getLexiconEntryData

          public java.lang.String[] getLexiconEntryData()

      Get String array containing lexicon data suitable for output.
      Returns:
        String array containing lexicon data items.

        The result String array contains the following entries:

        `result[0] : entry
        result[1] : entry count
        result[2] : first category tag
        result[3] : first category lemma
        result[4] : first category count
        result[5] : second category tag, if any
        result[6] : second category lemma
        result[7] : second category count, if any
        ...`

    - #### categoriesAndCountsClone

          protected java.util.Map<java.lang.String,MutableInteger> categoriesAndCountsClone()

      Deep clone of categories and counts map.
      Returns:
        Deep clone of the categories and counts map.

    - #### lemmataClone

          protected java.util.Map<java.lang.String,java.lang.String> lemmataClone()

      Deep clone of lemmata map.
      Returns:
        Deep clone of the lemmata map.

    - #### clone

          public java.lang.Object clone()

      Clone this lexicon entry.
      Specified by:
        `clone` in interface `XCloneable`
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        A deep clone of this lexicon entry.

    - #### deepClone

          public LexiconEntry deepClone()

      Deep clone of this lexicon entry.
      Returns:
        A deep clone of this lexicon entry.