edu.stanford.nlp.ling.tokensregex
Class CoreMapNodePattern

java.lang.Object
  extended by edu.stanford.nlp.ling.tokensregex.NodePattern<CoreMap>
      extended by edu.stanford.nlp.ling.tokensregex.CoreMapNodePattern

public class CoreMapNodePattern
extends NodePattern<CoreMap>

Pattern for matching a CoreMap

Author:
Angel Chang

Nested Class Summary
static class CoreMapNodePattern.AttributesEqualMatchChecker
           
static class CoreMapNodePattern.NilAnnotationPattern
           
static class CoreMapNodePattern.NotNilAnnotationPattern
           
static class CoreMapNodePattern.NumericAnnotationPattern
           
static class CoreMapNodePattern.SequenceRegexPattern<T>
           
static class CoreMapNodePattern.StringAnnotationPattern
           
static class CoreMapNodePattern.StringAnnotationRegexPattern
           
static class CoreMapNodePattern.StringInSetAnnotationPattern
           
 
Nested classes/interfaces inherited from class edu.stanford.nlp.ling.tokensregex.NodePattern
NodePattern.AnyNodePattern<T>, NodePattern.ConjNodePattern<T>, NodePattern.DisjNodePattern<T>, NodePattern.EqualsNodePattern<T>, NodePattern.NegateNodePattern<T>
 
Field Summary
static CoreMapNodePattern.AttributesEqualMatchChecker TEXT_ATTR_EQUAL_CHECKER
           
 
Fields inherited from class edu.stanford.nlp.ling.tokensregex.NodePattern
ANY_NODE
 
Constructor Summary
CoreMapNodePattern(java.lang.Class key, NodePattern pattern)
           
CoreMapNodePattern(java.util.List<Pair<java.lang.Class,NodePattern>> annotationPatterns)
           
CoreMapNodePattern(Pair<java.lang.Class,NodePattern>... annotationPatterns)
           
 
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
 

Field Detail

TEXT_ATTR_EQUAL_CHECKER

public static final CoreMapNodePattern.AttributesEqualMatchChecker TEXT_ATTR_EQUAL_CHECKER
Constructor Detail

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)
Method Detail

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