Package net.didion.jwnl.data
Class POS
- java.lang.Object
-
- net.didion.jwnl.data.POS
-
- All Implemented Interfaces:
java.io.Serializable
public final class POS extends java.lang.Object implements java.io.Serializable
Instances of this class enumerate the possible major syntactic categories, or Part's Of Speech. EachPOS
has a human-readable label that can be used to print it, and a key by which it can be looked up.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
_cachedToString
private Resolvable
_key
private Resolvable
_label
static POS
ADJECTIVE
static POS
ADVERB
private static java.util.List
ALL_POS
static POS
NOUN
(package private) static long
serialVersionUID
static POS
VERB
-
Constructor Summary
Constructors Modifier Constructor Description private
POS(java.lang.String label, java.lang.String key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
An instance of POS is equal to another iff they're underlying keys are equal.static java.util.List
getAllPOS()
java.lang.String
getKey()
Gets the key for this POS.java.lang.String
getLabel()
Return a label intended for textual presentation.static POS
getPOSForKey(java.lang.String key)
Return thePOS
whose key matches key, or null if the key does not match any POS.static POS
getPOSForLabel(java.lang.String label)
Return thePOS
whose key matches label, or null if the label does not match any POS.int
hashCode()
Returns the underlying pos key's hashcode.java.lang.String
toString()
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
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 java.util.List ALL_POS
-
_label
private Resolvable _label
-
_key
private Resolvable _key
-
_cachedToString
private transient java.lang.String _cachedToString
-
-
Method Detail
-
getAllPOS
public static java.util.List getAllPOS()
-
getPOSForLabel
public static POS getPOSForLabel(java.lang.String label)
Return thePOS
whose key matches label, or null if the label does not match any POS.
-
getPOSForKey
public static POS getPOSForKey(java.lang.String key)
Return thePOS
whose key matches key, or null if the key does not match any POS.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
Returns the underlying pos key's hashcode.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- key hash code
-
equals
public boolean equals(java.lang.Object obj)
An instance of POS is equal to another iff they're underlying keys are equal.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the comparison object- Returns:
- true if keys equal
-
getLabel
public java.lang.String getLabel()
Return a label intended for textual presentation.
-
getKey
public java.lang.String getKey()
Gets the key for this POS.- Returns:
- key
-
-