public static CoreMapNodePattern valueOf(Env env, String textAnnotationPattern) { CoreMapNodePattern p = new CoreMapNodePattern(new ArrayList<>(1)); p.add(CoreAnnotations.TextAnnotation.class, newStringRegexPattern(textAnnotationPattern, (env != null)? env.defaultStringPatternFlags: 0)); return p; }
public static CoreMapNodePattern valueOf(String textAnnotationPattern) { return valueOf(null, textAnnotationPattern); }
private static Pair<Class,CoreMapNodePattern.StringAnnotationPattern> _getStringAnnotation_(PatternExpr p) { if (p instanceof NodePatternExpr) { NodePattern nodePattern = ((NodePatternExpr) p).nodePattern; if (nodePattern instanceof CoreMapNodePattern) { List<Pair<Class, NodePattern>> annotationPatterns = ((CoreMapNodePattern) nodePattern).getAnnotationPatterns(); if (annotationPatterns.size() == 1) { // Check if it is a string annotation pattern Pair<Class, NodePattern> pair = annotationPatterns.get(0); if (pair.second instanceof CoreMapNodePattern.StringAnnotationPattern) { return Pair.makePair(pair.first, (CoreMapNodePattern.StringAnnotationPattern) pair.second); } } } } return null; } }
public static CoreMapNodePattern valueOf(Pattern textAnnotationPattern) { CoreMapNodePattern p = new CoreMapNodePattern(new ArrayList<>(1)); p.add(CoreAnnotations.TextAnnotation.class, new StringAnnotationRegexPattern(textAnnotationPattern)); return p; }
public static CoreMapNodePattern valueOf(Env env, Map<String, String> attributes) { CoreMapNodePattern p = new CoreMapNodePattern(new ArrayList<>(attributes.size())); p.populate(env, attributes, envAttrPair -> EnvLookup.lookupAnnotationKeyWithClassname(envAttrPair.first, envAttrPair.second)); return p; }
if (set.size() > OPTIMIZE_MIN_SIZE) { PatternExpr optimized = new NodePatternExpr( new CoreMapNodePattern(entry.getKey().first, new CoreMapNodePattern.StringInSetAnnotationPattern(set, flags))); finalOptimizedPatterns.add(optimized); for (PatternExpr p:saved.first) {
public static CoreMapNodePattern valueOf(SequencePattern.Env env, Map<String, String> attributes) { CoreMapNodePattern p = new CoreMapNodePattern(); p.annotationPatterns = new ArrayMap<Class,NodePattern>(attributes.size()); for (String attr:attributes.keySet()) { String value = attributes.get(attr); Class c = lookupAnnotationKey(env, attr); if (c != null) { if (value.startsWith("\"") && value.endsWith("\"")) {
public CoreMapNodePattern(List<Pair<Class, NodePattern>> annotationPatterns) { super(createGetter(), annotationPatterns); }
public static CoreMapNodePattern valueOf(Pattern textAnnotationPattern) { CoreMapNodePattern p = new CoreMapNodePattern(new ArrayList<Pair<Class, NodePattern>>(1)); p.add(CoreAnnotations.TextAnnotation.class, new StringAnnotationRegexPattern(textAnnotationPattern)); return p; }
public static CoreMapNodePattern valueOf(Env env, Map<String, String> attributes) { CoreMapNodePattern p = new CoreMapNodePattern(new ArrayList<>(attributes.size())); p.populate(env, attributes, envAttrPair -> EnvLookup.lookupAnnotationKeyWithClassname(envAttrPair.first, envAttrPair.second)); return p; }
public static CoreMapNodePattern valueOf(SequencePattern.Env env, String textAnnotationPattern) { CoreMapNodePattern p = new CoreMapNodePattern(); p.annotationPatterns = new ArrayMap<Class, NodePattern>(1); p.annotationPatterns.put(CoreAnnotations.TextAnnotation.class, new StringAnnotationRegexPattern(textAnnotationPattern, (env != null)? env.defaultStringPatternFlags: 0)); return p; }
public CoreMapNodePattern(Pair<Class, NodePattern>... annotationPatterns) { super(createGetter(), annotationPatterns); }
public static CoreMapNodePattern valueOf(String textAnnotationPattern, int flags) { CoreMapNodePattern p = new CoreMapNodePattern(new ArrayList<>(1)); p.add(CoreAnnotations.TextAnnotation.class, newStringRegexPattern(textAnnotationPattern, flags)); return p; }
public static CoreMapNodePattern valueOf(Map<String, String> attributes) { return valueOf(null, attributes); }
public static CoreMapNodePattern valueOf(Pattern textAnnotationPattern) { CoreMapNodePattern p = new CoreMapNodePattern(new ArrayList<>(1)); p.add(CoreAnnotations.TextAnnotation.class, new StringAnnotationRegexPattern(textAnnotationPattern)); return p; }
public static CoreMapNodePattern valueOf(Env env, Map<String, String> attributes) { CoreMapNodePattern p = new CoreMapNodePattern(new ArrayList<>(attributes.size())); p.populate(env, attributes, envAttrPair -> EnvLookup.lookupAnnotationKeyWithClassname(envAttrPair.first, envAttrPair.second)); return p; }
if (set.size() > OPTIMIZE_MIN_SIZE) { PatternExpr optimized = new NodePatternExpr( new CoreMapNodePattern(entry.getKey().first, new CoreMapNodePattern.StringInSetAnnotationPattern(set, flags))); finalOptimizedPatterns.add(optimized); for (PatternExpr p:saved.first) {