Class POS

java.lang.Object
net.didion.jwnl.data.POS
All Implemented Interfaces:
Serializable

public final class POS extends Object implements Serializable
Instances of this class enumerate the possible major syntactic categories, or Part's Of Speech. Each POS has a human-readable label that can be used to print it, and a key by which it can be looked up.
See Also:
  • Field Details

    • serialVersionUID

      static final long serialVersionUID
      See Also:
    • NOUN

      public static final POS NOUN
    • VERB

      public static final POS VERB
    • ADJECTIVE

      public static final POS ADJECTIVE
    • ADVERB

      public static final POS ADVERB
    • ALL_POS

      private static final List ALL_POS
    • _label

      private Resolvable _label
    • _key

      private Resolvable _key
    • _cachedToString

      private transient String _cachedToString
  • Constructor Details

  • Method Details

    • getAllPOS

      public static List getAllPOS()
    • getPOSForLabel

      public static POS getPOSForLabel(String label)
      Return the POS whose key matches label, or null if the label does not match any POS.
    • getPOSForKey

      public static POS getPOSForKey(String key)
      Return the POS whose key matches key, or null if the key does not match any POS.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Returns the underlying pos key's hashcode.
      Overrides:
      hashCode in class Object
      Returns:
      key hash code
    • equals

      public boolean equals(Object obj)
      An instance of POS is equal to another iff they're underlying keys are equal.
      Overrides:
      equals in class Object
      Parameters:
      obj - the comparison object
      Returns:
      true if keys equal
    • getLabel

      public String getLabel()
      Return a label intended for textual presentation.
    • getKey

      public String getKey()
      Gets the key for this POS.
      Returns:
      key