edu.northwestern.at.morphadorner.corpuslinguistics.partsofspeech

## Class PartOfSpeech

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.partsofspeech.PartOfSpeech

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable

      public class PartOfSpeech
      extends java.lang.Object
      implements java.lang.Comparable, java.io.Serializable

  A part of speech.

  This is a base class for parts of speech.

  .

  All part of speech entries have the following attributes:

  - A tag, e.g., "np1" for an singular proper name.
  - A word class for the part of speech.
  - A major word class for the part of speech.
  - An optional general tag name for the part of speech.
  - An optional description of the part of speech.
  - An optional lemmatization class for the part of speech.

  The general tag name allows reference to a few important tags in a tag set independent fashion. General tag names are defined as follows.

  General tag name | Meaning
  --- | ---
  noun-singular | Tag for a singular noun.
  noun-plural | Tag for a plural noun. | noun-proper-singular | Tag for a singular proper noun.
  noun-proper-plural | Tag for a plural proper noun.
  numeral-cardinal | Tag for a cardinal number.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `description` Description.
    `protected java.lang.String` | `generalTagName` General tag name.
    `protected java.lang.String` | `lemmaWordClass` Lemma word class.
    `protected java.lang.String` | `majorWordClass` Major word class.
    `protected java.lang.String` | `tag` Tag.
    `protected java.lang.String` | `wordClass` Word class.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PartOfSpeech()` Creates a new part of speech.
    `PartOfSpeech(java.lang.String tag, java.lang.String wordClass, java.lang.String majorWordClass, java.lang.String lemmaWordClass, java.lang.String generalTagName, java.lang.String description)` Creates a new part of speech.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(java.lang.Object object)` Compare this object to another.
    `boolean` | `equals(java.lang.Object obj)` Returns true if some other object is equal to this one.
    `java.lang.String` | `getDescription()` Gets the description.
    `java.lang.String` | `getGeneralTagName()` Gets the general tag name.
    `java.lang.String` | `getLemmaWordClass()` Gets the lemma word class.
    `java.lang.String` | `getMajorWordClass()` Gets the major word class.
    `java.lang.String` | `getTag()` Gets the tag.
    `java.lang.String` | `getWordClass()` Gets the word class.
    `int` | `hashCode()` Returns a hash code for the object.
    `void` | `setDescription(java.lang.String description)` Sets the description.
    `void` | `setGeneralTagName(java.lang.String generalTagName)` Sets the general tag name.
    `void` | `setLemmaWordClass(java.lang.String lemmaWordClass)` Sets the lemma word class.
    `void` | `setMajorWordClass(java.lang.String majorWordClass)` Sets the major word class.
    `void` | `setTag(java.lang.String tag)` Sets the tag.
    `void` | `setWordClass(java.lang.String wordClass)` Sets the word class.
    `java.lang.String` | `toString()` Gets a string representation of the part of speech.

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

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

- - ### Field Detail

    - #### tag

          protected java.lang.String tag

      Tag.

    - #### wordClass

          protected java.lang.String wordClass

      Word class.

    - #### majorWordClass

          protected java.lang.String majorWordClass

      Major word class.

    - #### generalTagName

          protected java.lang.String generalTagName

      General tag name.

    - #### description

          protected java.lang.String description

      Description.

    - #### lemmaWordClass

          protected java.lang.String lemmaWordClass

      Lemma word class.

  - ### Constructor Detail

    - #### PartOfSpeech

          public PartOfSpeech()

      Creates a new part of speech.

    - #### PartOfSpeech

          public PartOfSpeech(java.lang.String tag,
                      java.lang.String wordClass,
                      java.lang.String majorWordClass,
                      java.lang.String lemmaWordClass,
                      java.lang.String generalTagName,
                      java.lang.String description)

      Creates a new part of speech.
      Parameters:
        `tag` - Tag name.
        `wordClass` - The word class.
        `majorWordClass` - The major word class.
        `lemmaWordClass` - The lemma word class.
        `generalTagName` - The general tag name.
        `description` - The description.

  - ### Method Detail

    - #### getTag

          public java.lang.String getTag()

      Gets the tag.
      Returns:
        The tag.

    - #### setTag

          public void setTag(java.lang.String tag)

      Sets the tag.
      Parameters:
        `tag` - The tag.

    - #### getDescription

          public java.lang.String getDescription()

      Gets the description.
      Returns:
        The description, or null if none.

    - #### setDescription

          public void setDescription(java.lang.String description)

      Sets the description.
      Parameters:
        `description` - Description. May be empty.

    - #### getWordClass

          public java.lang.String getWordClass()

      Gets the word class.
      Returns:
        The word class. May be empty.

    - #### setWordClass

          public void setWordClass(java.lang.String wordClass)

      Sets the word class.
      Parameters:
        `wordClass` - The word class.

    - #### getMajorWordClass

          public java.lang.String getMajorWordClass()

      Gets the major word class.
      Returns:
        The major word class. May be empty.

    - #### setMajorWordClass

          public void setMajorWordClass(java.lang.String majorWordClass)

      Sets the major word class.
      Parameters:
        `majorWordClass` - The major word class.

    - #### getGeneralTagName

          public java.lang.String getGeneralTagName()

      Gets the general tag name.
      Returns:
        The general tag name. May be empty.

    - #### setGeneralTagName

          public void setGeneralTagName(java.lang.String generalTagName)

      Sets the general tag name.
      Parameters:
        `generalTagName` - The general tag name.

    - #### getLemmaWordClass

          public java.lang.String getLemmaWordClass()

      Gets the lemma word class.
      Returns:
        The lemma word class. May be empty.

    - #### setLemmaWordClass

          public void setLemmaWordClass(java.lang.String lemmaWordClass)

      Sets the lemma word class.
      Parameters:
        `lemmaWordClass` - The lemma word class.

    - #### toString

          public java.lang.String toString()

      Gets a string representation of the part of speech.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        The tag information as a string.

    - #### equals

          public boolean equals(java.lang.Object obj)

      Returns true if some other object is equal to this one.

      The two parts of speech are equal if their classes and tags are equal.

      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - The other object.
      Returns:
        True if this object equals the other object.

    - #### compareTo

          public int compareTo(java.lang.Object object)

      Compare this object to another.
      Specified by:
        `compareTo` in interface `java.lang.Comparable`
      Parameters:
        `object` - Other object.

        We only compare the tags.

    - #### hashCode

          public int hashCode()

      Returns a hash code for the object.
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        The hash code.