public class LexFile extends Object implements ILexFile
ILexFile interface. This class
includes, as public fields, all lexical files defined in the standard WordNet
distribution.
This class in not implemented as an Enum so that clients may
instantiate their own lexical file objects using this implementation.
| Constructor and Description |
|---|
LexFile(int num,
String name,
String desc,
POS pos)
Constructs a new lexical file description object.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
checkLexicalFileNumber(int num)
Throws an exception if the specified lexical file number is not a valid
lexical file number
|
protected static String |
checkString(String str)
Throws an exception if the specified string is
null, empty,
or all whitespace. |
boolean |
equals(Object obj) |
String |
getDescription()
Returns a description of the lexicographer file contents.
|
static LexFile |
getLexicalFile(int num)
A convenience method that allows retrieval of one of the built-in lexical
file descriptions given the number.
|
static String |
getLexicalFileNumberString(int num)
Returns a two-character string representation of a lexical file number,
zero-filled if necessary.
|
String |
getName()
Returns the name of the lexicographer file.
|
int |
getNumber()
Returns the number of the lexicographer file.
|
POS |
getPOS()
Returns the associated part of speech for this object.
|
int |
hashCode() |
static boolean |
isIllegalLexicalFileNumber(int num)
Returns
true if the number represents a valid lexical file
number, namely, a number in in the closed range [0, 99]; returns
false otherwise. |
protected Object |
readResolve()
This utility method implements the appropriate deserialization for this
object.
|
String |
toString() |
static Collection<LexFile> |
values()
Emulates the
Enum#values() function. |
public static final LexFile ADJ_ALL
public static final LexFile ADJ_PERT
public static final LexFile ADV_ALL
public static final LexFile NOUN_TOPS
public static final LexFile NOUN_ACT
public static final LexFile NOUN_ANIMAL
public static final LexFile NOUN_ARTIFACT
public static final LexFile NOUN_ATTRIBUTE
public static final LexFile NOUN_BODY
public static final LexFile NOUN_COGNITION
public static final LexFile NOUN_COMMUNICATION
public static final LexFile NOUN_EVENT
public static final LexFile NOUN_FEELING
public static final LexFile NOUN_FOOD
public static final LexFile NOUN_GROUP
public static final LexFile NOUN_LOCATION
public static final LexFile NOUN_MOTIVE
public static final LexFile NOUN_OBJECT
public static final LexFile NOUN_PERSON
public static final LexFile NOUN_PHENOMENON
public static final LexFile NOUN_PLANT
public static final LexFile NOUN_POSSESSION
public static final LexFile NOUN_PROCESS
public static final LexFile NOUN_QUANTITY
public static final LexFile NOUN_RELATION
public static final LexFile NOUN_SHAPE
public static final LexFile NOUN_STATE
public static final LexFile NOUN_SUBSTANCE
public static final LexFile NOUN_TIME
public static final LexFile VERB_BODY
public static final LexFile VERB_CHANGE
public static final LexFile VERB_COGNITION
public static final LexFile VERB_COMMUNICATION
public static final LexFile VERB_COMPETITION
public static final LexFile VERB_CONSUMPTION
public static final LexFile VERB_CONTACT
public static final LexFile VERB_CREATION
public static final LexFile VERB_EMOTION
public static final LexFile VERB_MOTION
public static final LexFile VERB_PERCEPTION
public static final LexFile VERB_POSESSION
public static final LexFile VERB_SOCIAL
public static final LexFile VERB_STATIVE
public static final LexFile VERB_WEATHER
public static final LexFile ADJ_PPL
public LexFile(int num,
String name,
String desc,
POS pos)
num - the lexical file number, in the closed range [0,99]name - the name of the lexical file, may not be null,
empty, or all whitespacedesc - the description of the lexical file, may not be
null, empty, or all whitespacepos - the part of speech for the lexical file, may be
nullNullPointerException - if either the name or description are nullIllegalArgumentException - if either the name or description are empty or all whitespacepublic int getNumber()
ILexFilepublic POS getPOS()
IHasPOSnull.public String getName()
ILexFilenull, empty, or all whitespace.public String getDescription()
ILexFilenull, empty, or all whitespace.getDescription in interface ILexFileprotected Object readResolve()
protected static String checkString(String str)
null, empty,
or all whitespace. Returns a trimmed form of the string.str - the string to be checkedNullPointerException - if the specified string is nullIllegalArgumentException - if the specified string is empty or all whitespacepublic static void checkLexicalFileNumber(int num)
num - the number to be checkedIllegalArgumentException - if the specified lexical file number is not a legal lexical
file numberpublic static boolean isIllegalLexicalFileNumber(int num)
true if the number represents a valid lexical file
number, namely, a number in in the closed range [0, 99]; returns
false otherwise.num - the number to be checkedtrue if the number represents a valid lexical file
number, namely, a number in in the closed range [0, 99]; returns
false otherwise.public static String getLexicalFileNumberString(int num)
num - the number to be representedIllegalArgumentException - if the specified integer is not a legal lexical file numberpublic static Collection<LexFile> values()
Enum#values() function. Returns an unmodifiable
collection of all the lexical file descriptions declared in this class,
in the order they are declared.public static LexFile getLexicalFile(int num)
null.num - the number for the lexical file objectCopyright © 2018. All rights reserved.