@Override public boolean match(T node) { return !p.match(node); }
Object obj = pattern.matchWithResult(node); if (obj != null) { if (obj != Boolean.TRUE) { if (node != null && pattern.match(node)) {
protected boolean match(M token, Map<K,Object> matchResults) { boolean matched = true; for (Pair<K,NodePattern> entry:annotationPatterns) { NodePattern annoPattern = entry.second; Object anno = getter.apply(token, entry.first); Object matchResult = annoPattern.matchWithResult(anno); if (matchResult != null) { matchResults.put(entry.first, matchResult); } else { matched = false; break; } } return matched; }
protected boolean match(M token, Map<K,Object> matchResults) { boolean matched = true; for (Pair<K,NodePattern> entry:annotationPatterns) { NodePattern annoPattern = entry.second; Object anno = getter.apply(token, entry.first); Object matchResult = annoPattern.matchWithResult(anno); if (matchResult != null) { matchResults.put(entry.first, matchResult); } else { matched = false; break; } } return matched; }
@Override public boolean match(T node) { boolean matched = false; for (NodePattern<T> p:nodePatterns) { if (p.match(node)) { matched = true; break; } } return matched; }
Object obj = pattern.matchWithResult(node); if (obj != null) { if (obj != Boolean.TRUE) { if (node != null && pattern.match(node)) {
protected boolean match(M token, Map<K,Object> matchResults) { boolean matched = true; for (Pair<K,NodePattern> entry:annotationPatterns) { NodePattern annoPattern = entry.second; Object anno = getter.apply(token, entry.first); Object matchResult = annoPattern.matchWithResult(anno); if (matchResult != null) { matchResults.put(entry.first, matchResult); } else { matched = false; break; } } return matched; }
/** * Returns result associated with the match * @param node node to match * @return 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. */ public Object matchWithResult(T node) { if (match(node)) return Boolean.TRUE; else return null; }
Object obj = pattern.matchWithResult(node); if (obj != null) { if (obj != Boolean.TRUE) { if (node != null && pattern.match(node)) {
protected boolean match(CoreMap token, Map<Class,Object> matchResults) { boolean matched = true; for (Pair<Class,NodePattern> entry:annotationPatterns) { NodePattern annoPattern = entry.second; Object anno = token.get(entry.first); Object matchResult = annoPattern.matchWithResult(anno); if (matchResult != null) { matchResults.put(entry.first, matchResult); } else { matched = false; break; } } return matched; }
@Override public boolean match(T node) { boolean matched = true; for (NodePattern<T> p:nodePatterns) { if (!p.match(node)) { matched = false; break; } } return matched; }
Object obj = pattern.matchWithResult(node); if (obj != null) { if (obj != Boolean.TRUE) { if (node != null && pattern.match(node)) {
protected boolean match(CoreMap token, Map<Class,Object> matchResults) { boolean matched = true; for (Map.Entry<Class,NodePattern> entry:annotationPatterns.entrySet()) { NodePattern annoPattern = entry.getValue(); Object anno = token.get(entry.getKey()); Object matchResult = annoPattern.matchWithResult(anno); if (matchResult != null) { matchResults.put(entry.getKey(), matchResult); } else { matched = false; break; } } return matched; }
@Override public boolean match(M token) { boolean matched = true; for (Pair<K,NodePattern> entry:annotationPatterns) { NodePattern annoPattern = entry.second; Object anno = getter.apply(token, entry.first); if (!annoPattern.match(anno)) { matched = false; break; } } return matched; }
protected Collection<Interval<Integer>> match(List<? extends CoreMap> nodes, int start) { List<Interval<Integer>> matched = new ArrayList<>(); int minEnd = start + minNodes; int maxEnd = nodes.size(); if (maxNodes >= 0 && maxNodes + start < nodes.size()) { maxEnd = maxNodes + start; } for (int end = minEnd; end <= maxEnd; end++) { CoreMap chunk = ChunkAnnotationUtils.getMergedChunk(nodes, start, end, aggregators, null); if (nodePattern.match(chunk)) { matched.add(Interval.toInterval(start, end)); } } return matched; }
@Override public boolean match(T node) { boolean matched = false; for (NodePattern<T> p:nodePatterns) { if (p.match(node)) { matched = true; break; } } return matched; }
protected boolean match(T node) { boolean matched = false; for (NodePattern<T> p:nodePatterns) { if (p.match(node)) { matched = true; break; } } return matched; } }
@Override public boolean match(T node) { boolean matched = true; for (NodePattern<T> p:nodePatterns) { if (!p.match(node)) { matched = false; break; } } return matched; }
@Override public boolean match(T node) { return !p.match(node); }
/** * Returns result associated with the match * @param node node to match * @return 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. */ public Object matchWithResult(T node) { if (match(node)) return Boolean.TRUE; else return null; }