public class ProperNouns extends java.lang.Object implements IMWEDetector
| Modifier | Constructor and Description |
|---|---|
protected |
ProperNouns()
This constructor is marked protected so that this class may be
subclassed, but not directly instantiated.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends IToken> |
detect(java.util.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 <T extends IToken> |
isProperNoun(T token)
Checks if the token represents a proper noun by checking its part of
speech tag.
|
protected <T extends IToken> |
isValidInterstitial(T token,
java.util.LinkedList<T> tokens)
Checks if a token that is not a proper noun may still be a part of a
proper noun MWE.
|
protected <T extends IToken> |
removeIncorrectInterstitials(java.util.LinkedList<T> cs)
Removes all the tokens from the end of the given list that are not proper
nouns.
|
protected ProperNouns()
public static ProperNouns getInstance()
public <T extends IToken> java.util.List<IMWE<T>> detect(java.util.List<T> sentence)
IMWEDetectorIMWE 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 IMWEDetectorT - 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 nullprotected <T extends IToken> boolean isValidInterstitial(T token, java.util.LinkedList<T> tokens)
T - the type of tokentoken - is the token to checktokens - List of IToken objects representing a possible MWEprotected <T extends IToken> void removeIncorrectInterstitials(java.util.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 checkCopyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.