edu.northwestern.at.morphadorner.tools.taggertrainer

## Class TagError

- java.lang.Object
- - edu.northwestern.at.morphadorner.tools.taggertrainer.TagError

- All Implemented Interfaces:
    java.lang.Comparable

      public class TagError
      extends java.lang.Object
      implements java.lang.Comparable

  Tag confusion matrix entry.

  A TagError entry contains a (correct tag, incorrect tag, error count) tuple. The error count is the number of times a part of speech tagger generated "incorrect tag" instead of "correct tag" in a tagged corpus. A list of TagError entries can be used by a transformation based learning program to generate contextual rules to correct the tag errors.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.String` | `correctTag` Correct tag.
    `java.util.List<java.lang.Integer>` | `errorPositions` List of word positions where this error occurs.
    `protected int` | `hashCode` The hash code.
    `java.lang.String` | `incorrectTag` Incorrect tag.
    `int` | `incorrectTagCount` Number of times incorrect tag appears instead of correct tag.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TagError(java.lang.String correctTag, java.lang.String incorrectTag, java.util.List<java.lang.Integer> errorPositions)` Create a tag error entry.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(java.lang.Object object)` Compare this object with another.
    `boolean` | `equals(java.lang.Object object)` Check if another object is equal to this one.
    `int` | `hashCode()` Get the hash code of the keys.
    `java.lang.String` | `toString()` Return a string representation of this object.

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

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

- - ### Field Detail

    - #### correctTag

          public final java.lang.String correctTag

      Correct tag.

    - #### incorrectTag

          public final java.lang.String incorrectTag

      Incorrect tag.

    - #### errorPositions

          public final java.util.List<java.lang.Integer> errorPositions

      List of word positions where this error occurs.

    - #### incorrectTagCount

          public final int incorrectTagCount

      Number of times incorrect tag appears instead of correct tag.

    - #### hashCode

          protected final int hashCode

      The hash code.

  - ### Constructor Detail

    - #### TagError

          public TagError(java.lang.String correctTag,
                  java.lang.String incorrectTag,
                  java.util.List<java.lang.Integer> errorPositions)

      Create a tag error entry.
      Parameters:
        `correctTag` - The correct part of speech tag.
        `incorrectTag` - The incorrect part of speech tag.
        `errorPositions` - The list of tag error positions.

  - ### Method Detail

    - #### equals

          public boolean equals(java.lang.Object object)

      Check if another object is equal to this one.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `object` - Other object to test for equality.
      Returns:
        true if other object is equal to this one.

    - #### compareTo

          public int compareTo(java.lang.Object object)

      Compare this object with another.
      Specified by:
        `compareTo` in interface `java.lang.Comparable`
      Parameters:
        `object` - The other object.
      Returns:
        < 0 if the other object is less than this one, = 0 if the two objects are equal, > 0 if the other object is greater than this one.

        We use compareTo on the array entries in the key. This may not give the desired result if the array entries are themselves arrays.

    - #### hashCode

          public int hashCode()

      Get the hash code of the keys.
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        The hash code.

    - #### toString

          public java.lang.String toString()

      Return a string representation of this object.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        A string representation of this object.