edu.stanford.nlp.ling.tokensregex
Class CoreMapNodePattern
java.lang.Object
edu.stanford.nlp.ling.tokensregex.NodePattern<CoreMap>
edu.stanford.nlp.ling.tokensregex.CoreMapNodePattern
public class CoreMapNodePattern
- extends NodePattern<CoreMap>
Pattern for matching a CoreMap
- Author:
- Angel Chang
|
Method Summary |
void |
add(java.lang.Class c,
NodePattern pattern)
|
java.util.List<Pair<java.lang.Class,NodePattern>> |
getAnnotationPatterns()
|
boolean |
match(CoreMap token)
Returns true if the input node matches this pattern |
protected boolean |
match(CoreMap token,
java.util.Map<java.lang.Class,java.lang.Object> matchResults)
|
java.lang.Object |
matchWithResult(CoreMap token)
Returns result associated with the match |
static NodePattern<java.lang.String> |
newStringRegexPattern(java.lang.String regex,
int flags)
|
java.lang.String |
toString()
|
static CoreMapNodePattern |
valueOf(Env env,
java.util.Map<java.lang.String,java.lang.String> attributes)
|
static CoreMapNodePattern |
valueOf(Env env,
java.lang.String textAnnotationPattern)
|
static CoreMapNodePattern |
valueOf(java.util.Map<java.lang.String,java.lang.String> attributes)
|
static CoreMapNodePattern |
valueOf(java.util.regex.Pattern textAnnotationPattern)
|
static CoreMapNodePattern |
valueOf(java.lang.String textAnnotationPattern)
|
static CoreMapNodePattern |
valueOf(java.lang.String textAnnotationPattern,
int flags)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TEXT_ATTR_EQUAL_CHECKER
public static final CoreMapNodePattern.AttributesEqualMatchChecker TEXT_ATTR_EQUAL_CHECKER
CoreMapNodePattern
public CoreMapNodePattern(java.util.List<Pair<java.lang.Class,NodePattern>> annotationPatterns)
CoreMapNodePattern
public CoreMapNodePattern(Pair<java.lang.Class,NodePattern>... annotationPatterns)
CoreMapNodePattern
public CoreMapNodePattern(java.lang.Class key,
NodePattern pattern)
getAnnotationPatterns
public java.util.List<Pair<java.lang.Class,NodePattern>> getAnnotationPatterns()
newStringRegexPattern
public static NodePattern<java.lang.String> newStringRegexPattern(java.lang.String regex,
int flags)
valueOf
public static CoreMapNodePattern valueOf(java.lang.String textAnnotationPattern)
valueOf
public static CoreMapNodePattern valueOf(java.lang.String textAnnotationPattern,
int flags)
valueOf
public static CoreMapNodePattern valueOf(Env env,
java.lang.String textAnnotationPattern)
valueOf
public static CoreMapNodePattern valueOf(java.util.regex.Pattern textAnnotationPattern)
valueOf
public static CoreMapNodePattern valueOf(java.util.Map<java.lang.String,java.lang.String> attributes)
valueOf
public static CoreMapNodePattern valueOf(Env env,
java.util.Map<java.lang.String,java.lang.String> attributes)
add
public void add(java.lang.Class c,
NodePattern pattern)
match
public boolean match(CoreMap token)
- Description copied from class:
NodePattern
- Returns true if the input node matches this pattern
- Specified by:
match in class NodePattern<CoreMap>
- Parameters:
token - - node to match
- Returns:
- true if the node matches the pattern, false otherwise
matchWithResult
public java.lang.Object matchWithResult(CoreMap token)
- Description copied from class:
NodePattern
- Returns result associated with the match
- Overrides:
matchWithResult in class NodePattern<CoreMap>
- Parameters:
token - node to match
- Returns:
- null if not matched, TRUE if there is a match but no other result associated with the match.
Any other value is treated as the result value of the match.
match
protected boolean match(CoreMap token,
java.util.Map<java.lang.Class,java.lang.Object> matchResults)
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Stanford NLP Group