|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jsemcor.element.Punc
public class Punc
Default, concrete implementation of IPunc
, with all punctuation
listed in the Semcor documentation, plus a few extras not mentioned, e.g.,
HYPHEN
, PERCENT
, STAR
, PLUS
, and
AMPERSAND
. This class is not implemented as an Enum
so that
clients can instantiate their own instances of this class without
re-implementing the interface.
Field Summary | |
---|---|
static Punc |
AMPERSAND
|
static Punc |
APOSTROPHE
|
static Punc |
CLOSED_QUOTE
|
static Punc |
COLON
|
static Punc |
COMMA
|
static Punc |
DEGREES
|
static Punc |
DOLLAR_SIGN
|
static Punc |
EXCLAMATION_PT
|
static Punc |
HYPHEN
|
static Punc |
LEFT_BRACKET
|
static Punc |
LEFT_PAREN
|
static Punc |
OPEN_QUOTE
|
static Punc |
PERCENT
|
static Punc |
PERIOD
|
static Punc |
PLUS
|
static Punc |
QUESTION_MARK
|
static Punc |
RIGHT_BRACKET
|
static Punc |
RIGHT_PAREN
|
static Punc |
SEMICOLON
|
static Punc |
SLASH
|
static Punc |
STAR
|
Fields inherited from interface edu.mit.jsemcor.element.IPunc |
---|
TAG_PUNC_END, TAG_PUNC_START, TAG_PUNC_VALUE |
Fields inherited from interface edu.mit.jsemcor.element.IElement |
---|
CLOSE_QUOTE, EQUALS, FORWARD_SLASH, LEFT_ANGLE_BRACKET, NEWLINE, RIGHT_ANGLE_BRACKET, SPACE, SPACE_STR, UNDERSCORE, UNDERSCORE_STR |
Constructor Summary | |
---|---|
Punc(String name,
char displayChar,
String symbol)
Constructs a new Category with the specified name. |
Method Summary | |
---|---|
String |
getData()
Returns the String representation of this element, as it would be
found in the concordance file. |
char |
getDisplayCharacter()
Returns the character that is used to display this punctuation on screen. |
static Punc |
getInstance(String symbol)
Returns the Punc object for the specified value, or
null if there no static final instance for this value
exists. |
String |
getName()
Returns a user-readable name that identifies this punctuation object. |
String |
getSymbol()
Returns the symbol (one or possibly two characters) used to identify this punctuation in context files. |
String |
getText()
The actual string contained between the SGML brackets in the Semcor data file. |
static boolean |
isClosingDelimiter(IToken p)
Returns whether the specified token is the same as one of the static final closing delimiter punctuation marks, i.e., the double-quote, right parenthesis, or right bracket. |
static boolean |
isClosingDelimiter(String p)
Returns whether the specified string is the same as one of the static final closing delimiter punctuation mark strings, i.e., the double-quote, right parenthesis, or right bracket. |
static boolean |
isOpeningDelimiter(IToken p)
Returns whether the specified token is the same as one of the static final opening delimiter punctuation marks, i.e., the double-quote, left parenthesis, or left bracket. |
static boolean |
isOpeningDelimiter(String p)
Returns whether the specified token is the same as one of the static final opening delimiter punctuation mark strings, i.e., the double-quote, left parenthesis, or left bracket. |
static boolean |
isPhraseDelimiter(IToken p)
Returns whether the specified token is the same as one of the static final phrase delimiter punctuation marks, i.e., the comma, colon, or semicolon. |
static boolean |
isPhraseDelimiter(String p)
Returns whether the specified string is the same as one of the static final phrase delimiter punctuation mark strings, i.e., the comma, colon, or semicolon. |
static boolean |
isSentenceFinal(IToken p)
Returns whether the specified token is the same as one of the static final sentence-final punctuation marks, i.e., the period, exclamation point, or question mark. |
static boolean |
isSentenceFinal(String p)
Returns whether the specified string is the same as one of the static final sentence-final punctuation mark strings, i.e., the period, exclamation point, or question mark. |
String |
toString()
|
static Collection<Punc> |
values()
This functions emulates the function of the same name found on each Enum class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Punc COMMA
public static final Punc PERIOD
public static final Punc QUESTION_MARK
public static final Punc EXCLAMATION_PT
public static final Punc SEMICOLON
public static final Punc LEFT_PAREN
public static final Punc RIGHT_PAREN
public static final Punc LEFT_BRACKET
public static final Punc RIGHT_BRACKET
public static final Punc APOSTROPHE
public static final Punc OPEN_QUOTE
public static final Punc CLOSED_QUOTE
public static final Punc DOLLAR_SIGN
public static final Punc COLON
public static final Punc HYPHEN
public static final Punc SLASH
public static final Punc DEGREES
public static final Punc PERCENT
public static final Punc STAR
public static final Punc PLUS
public static final Punc AMPERSAND
Constructor Detail |
---|
public Punc(String name, char displayChar, String symbol)
NullPointerException
- if either string is null
IllegalArgumentException
- if either string is empty or all whitespaceMethod Detail |
---|
public String getText()
IToken
getText
in interface IToken
public String getName()
IPunc
getName
in interface IPunc
public char getDisplayCharacter()
IPunc
getDisplayCharacter
in interface IPunc
public String getSymbol()
IPunc
getSymbol
in interface IPunc
public String getData()
IElement
String
representation of this element, as it would be
found in the concordance file.
getData
in interface IElement
public String toString()
toString
in class Object
public static final Collection<Punc> values()
Enum
class. This method returns a static, unmodifiable collection
containing all the instances of this type that are declared in static
fields in this concrete class.
public static final Punc getInstance(String symbol)
Punc
object for the specified value, or
null
if there no static final instance for this value
exists.
public static boolean isSentenceFinal(IToken p)
true
if the specified token is equal to the
PERIOD
, EXCLAMATION_PT
, or
QUESTION_MARK
punctuation objects; false
otherwise.public static boolean isSentenceFinal(String p)
true
if the specified string is equal to the value
of the PERIOD
, EXCLAMATION_PT
, or
QUESTION_MARK
punctuation objects; false
otherwise.public static boolean isOpeningDelimiter(IToken p)
true
if the specified token is equal to the
OPEN_QUOTE
, LEFT_PAREN
, or
LEFT_BRACKET
punctuation objects; false
otherwise.public static boolean isOpeningDelimiter(String p)
true
if the specified string is equal to the value
of the OPEN_QUOTE
, LEFT_PAREN
, or
LEFT_BRACKET
punctuation objects; false
otherwise.public static boolean isClosingDelimiter(IToken p)
true
if the specified token is equal to the
OPEN_QUOTE
, RIGHT_PAREN
, or
RIGHT_BRACKET
punctuation objects; false
otherwise.public static boolean isClosingDelimiter(String p)
true
if the specified string is equal to the value
of the OPEN_QUOTE
, RIGHT_PAREN
, or
RIGHT_BRACKET
punctuation objects; false
otherwise.public static boolean isPhraseDelimiter(IToken p)
true
if the specified token is equal to the
COMMA
, COLON
, or SEMICOLON
punctuation objects; false
otherwise.public static boolean isPhraseDelimiter(String p)
true
if the specified string is equal to the value
of the COMMA
, COLON
, or SEMICOLON
punctuation objects; false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |