edu.northwestern.at.morphadorner.corpuslinguistics.adornedword

## Class BaseAdornedWord

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.adornedword.BaseAdornedWord

- All Implemented Interfaces:
    AdornedWord, XCloneable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
  Direct Known Subclasses:
    AdornedWordCountInfo, ExtendedAdornedWord

      public class BaseAdornedWord
      extends java.lang.Object
      implements AdornedWord, XCloneable, java.lang.Comparable, java.io.Serializable

  A word adorned with addition morphological information.

  An `AdornedWord` represents a single word spelling, symbol, or punctuation mark in text.

  An adorned word records the following information.

  - The original form of the token as it appears in input text.
  - The spelling form of the token with transcription errors corrected. This is the form used by MorphAdorner for subsequent morphological processing.
  - A standard spelling. This is the standard modern form of the spelling for a word. If the word is obsolete, the standard form is the most recent commonly used spelling.
  - A lemma. This is the standard dictionary headword form of the spelling. Some spellings such as contractions contain multiple lemmata. In this case, the lemma consists of a string of individual lemmata separated by a separator character, usually a vertical bar "|". For example, the lemma form of the contraction "isn't" is "be|not".
  - A part of speech. Each lemma form in the spelling has an associated part of speech. Depending upon the tag set, the individual parts of speech may be separated by colons, slashes, vertical bars, etc.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `lemmata` Lemmata for spelling.
    `protected java.lang.String` | `partsOfSpeech` Parts of speech for spelling.
    `protected java.lang.String` | `spelling` Corrected spelling.
    `protected java.lang.String` | `standardSpelling` Standardized spelling.
    `protected java.lang.String` | `token` Token form of spelling.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseAdornedWord()` Create an empty adorned word.
    `BaseAdornedWord(AdornedWord adornedWord)` Create a adorned word from another adorned word.
    `BaseAdornedWord(java.lang.String spelling)` Create adorned word from a spelling.
    `BaseAdornedWord(java.lang.String spelling, java.lang.String partsOfSpeech)` Create adorned word from a spelling and a part of speech.
    `BaseAdornedWord(java.lang.String token, java.lang.String spelling, java.lang.String partsOfSpeech)` Create adorned word from a token, spelling, and part of speech.
    `BaseAdornedWord(java.lang.String token, java.lang.String spelling, java.lang.String standardSpelling, java.lang.String lemmata, java.lang.String partsOfSpeech)` Create adorned word from a token, spelling, standard spelling, lemmata, and parts of speech.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `clone()` Return a shallow cloned copy of this object.
    `int` | `compareTo(java.lang.Object object)` Compare this key with another.
    `boolean` | `equals(java.lang.Object object)` Check if another object is equal to this one.
    `java.lang.String` | `getLemmata()` Get the lemmata.
    `java.lang.String` | `getPartsOfSpeech()` Get the parts of speech.
    `java.lang.String` | `getSpelling()` Get the spelling.
    `java.lang.String` | `getStandardSpelling()` Get the standard spelling.
    `java.lang.String` | `getToken()` Get the original token.
    `int` | `hashCode()` Get the hash code of the keys.
    `void` | `setLemmata(java.lang.String lemmata)` Set the lemmata.
    `void` | `setPartsOfSpeech(java.lang.String partsOfSpeech)` Set the parts of speech.
    `void` | `setSpelling(java.lang.String spelling)` Set the spelling.
    `void` | `setStandardSpelling(java.lang.String standardSpelling)` Set the standard spelling.
    `void` | `setToken(java.lang.String token)` Set the original token.
    `java.lang.String` | `toString()` Return a string representation of this object.

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

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

- - ### Field Detail

    - #### token

          protected java.lang.String token

      Token form of spelling.

    - #### spelling

          protected java.lang.String spelling

      Corrected spelling.

    - #### standardSpelling

          protected java.lang.String standardSpelling

      Standardized spelling.

    - #### lemmata

          protected java.lang.String lemmata

      Lemmata for spelling.

    - #### partsOfSpeech

          protected java.lang.String partsOfSpeech

      Parts of speech for spelling.

  - ### Constructor Detail

    - #### BaseAdornedWord

          public BaseAdornedWord()

      Create an empty adorned word.

    - #### BaseAdornedWord

          public BaseAdornedWord(java.lang.String spelling)

      Create adorned word from a spelling.
      Parameters:
        `spelling` - The spelling.

        The token, the spelling, and the standard spelling are all set the the spelling parameter value.

    - #### BaseAdornedWord

          public BaseAdornedWord(java.lang.String spelling,
                         java.lang.String partsOfSpeech)

      Create adorned word from a spelling and a part of speech.
      Parameters:
        `spelling` - The spelling.
        `partsOfSpeech` - The part of speech.

    - #### BaseAdornedWord

          public BaseAdornedWord(java.lang.String token,
                         java.lang.String spelling,
                         java.lang.String partsOfSpeech)

      Create adorned word from a token, spelling, and part of speech.
      Parameters:
        `token` - The token.
        `spelling` - The spelling.
        `partsOfSpeech` - The part of speech.

    - #### BaseAdornedWord

          public BaseAdornedWord(java.lang.String token,
                         java.lang.String spelling,
                         java.lang.String standardSpelling,
                         java.lang.String lemmata,
                         java.lang.String partsOfSpeech)

      Create adorned word from a token, spelling, standard spelling, lemmata, and parts of speech.
      Parameters:
        `token` - The token.
        `spelling` - The spelling.
        `standardSpelling` - The standard spelling.
        `lemmata` - The lemmata.
        `partsOfSpeech` - The parts of speech.

    - #### BaseAdornedWord

          public BaseAdornedWord(AdornedWord adornedWord)

      Create a adorned word from another adorned word.
      Parameters:
        `adornedWord` - A adorned word.

  - ### Method Detail

    - #### getToken

          public java.lang.String getToken()

      Get the original token.
      Specified by:
        `getToken` in interface `AdornedWord`
      Returns:
        The original token.

    - #### setToken

          public void setToken(java.lang.String token)

      Set the original token.
      Specified by:
        `setToken` in interface `AdornedWord`
      Parameters:
        `token` - The original token.

    - #### getSpelling

          public java.lang.String getSpelling()

      Get the spelling.
      Specified by:
        `getSpelling` in interface `AdornedWord`
      Returns:
        The spelling.

    - #### setSpelling

          public void setSpelling(java.lang.String spelling)

      Set the spelling.
      Specified by:
        `setSpelling` in interface `AdornedWord`
      Parameters:
        `spelling` - The spelling.

    - #### getStandardSpelling

          public java.lang.String getStandardSpelling()

      Get the standard spelling.
      Specified by:
        `getStandardSpelling` in interface `AdornedWord`
      Returns:
        The standard spelling.

    - #### setStandardSpelling

          public void setStandardSpelling(java.lang.String standardSpelling)

      Set the standard spelling.
      Specified by:
        `setStandardSpelling` in interface `AdornedWord`
      Parameters:
        `standardSpelling` - The standard spelling.

    - #### getLemmata

          public java.lang.String getLemmata()

      Get the lemmata.
      Specified by:
        `getLemmata` in interface `AdornedWord`
      Returns:
        The lemmata.

        Compound lemmata are separated by a separator tring.

    - #### setLemmata

          public void setLemmata(java.lang.String lemmata)

      Set the lemmata.
      Specified by:
        `setLemmata` in interface `AdornedWord`
      Parameters:
        `lemmata` - The lemmata.

    - #### getPartsOfSpeech

          public java.lang.String getPartsOfSpeech()

      Get the parts of speech.
      Specified by:
        `getPartsOfSpeech` in interface `AdornedWord`
      Returns:
        The parts of speech.

    - #### setPartsOfSpeech

          public void setPartsOfSpeech(java.lang.String partsOfSpeech)

      Set the parts of speech.
      Specified by:
        `setPartsOfSpeech` in interface `AdornedWord`
      Parameters:
        `partsOfSpeech` - The parts of speech, separated by a tag set dependent separator string.

    - #### 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.

        Two word objects are equal if their spellings, lemmata, and parts of speech are equal.

    - #### compareTo

          public int compareTo(java.lang.Object object)

      Compare this key with another.
      Specified by:
        `compareTo` in interface `java.lang.Comparable`
      Parameters:
        `object` - The other CompoundKey.
      Returns:
        -1, 0, 1 depending opne whether this adorned word is less than, equal to, or greater than another adorned word.

        Two word objects are compared first on their spellings, then their lemmata, and finally their parts of speech.

    - #### 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 = original spelling.

    - #### clone

          public java.lang.Object clone()

      Return a shallow cloned copy of this object.
      Specified by:
        `clone` in interface `XCloneable`
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        Shallow clone of this object.
      Throws:
        `java.lang.CloneNotSupportedException` - which should never happen.