|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jmwe.detect.ProperNouns
public class ProperNouns
Detects the proper nouns in an ISentence. For this detector to work, the ITokens in the sentence must be tagged with a part of speech.
Constructor Summary | |
---|---|
protected |
ProperNouns()
This constructor is marked protected so that this class may be subclassed, but not directly instantiated. |
Method Summary | ||
---|---|---|
|
detect(List<T> sentence)
Given a list of tokens, the detector searches for the MWEs in the list. |
|
static ProperNouns |
getInstance()
Returns the singleton instance of this class, instantiating if necessary. |
|
static
|
isProperNoun(T token)
Checks if the token represents a proper noun by checking its part of speech tag. |
|
protected
|
isValidInterstitial(T token,
LinkedList<T> tokens)
Checks if a token that is not a proper noun may still be a part of a proper noun MWE. |
|
protected
|
removeIncorrectInterstitials(LinkedList<T> cs)
Removes all the tokens from the end of the given list that are not proper nouns. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ProperNouns()
Method Detail |
---|
public static ProperNouns getInstance()
public <T extends IToken> List<IMWE<T>> detect(List<T> sentence)
IMWEDetector
IMWE
objects representing these
multi-word expressions. The method returns an empty list if no MWEs are
found; the method should never return null
.
detect
in interface IMWEDetector
T
- the type of the tokens in the sentencesentence
- a sentence which the detector should search for multi-word
expressions.
IMWE
objects representing the multi-word
expressions found in the sentence. Returns an empty list if no
multi-word expressions are found; never returns null
protected <T extends IToken> boolean isValidInterstitial(T token, LinkedList<T> tokens)
T
- the type of tokentoken
- is the token to checktokens
- List of IToken
objects representing a possible MWE
protected <T extends IToken> void removeIncorrectInterstitials(LinkedList<T> cs)
T
- the type of tokens in the listcs
- the list from which tokens will be removed until the last
token is a proper nounpublic static <T extends IToken> boolean isProperNoun(T token)
T
- the type of tokentoken
- is the token to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |