public class TagError
extends java.lang.Object
implements java.lang.Comparable
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.
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 and Description |
---|
TagError(java.lang.String correctTag,
java.lang.String incorrectTag,
java.util.List<java.lang.Integer> errorPositions)
Create a tag error entry.
|
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.
|
public final java.lang.String correctTag
public final java.lang.String incorrectTag
public final java.util.List<java.lang.Integer> errorPositions
public final int incorrectTagCount
protected final int hashCode
public TagError(java.lang.String correctTag, java.lang.String incorrectTag, java.util.List<java.lang.Integer> errorPositions)
correctTag
- The correct part of speech tag.incorrectTag
- The incorrect part of speech tag.errorPositions
- The list of tag error positions.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- Other object to test for equality.public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
object
- The other object.We use compareTo on the array entries in the key. This may not give the desired result if the array entries are themselves arrays.
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object