# nlp

### Tregex Patterns

Symbol | Meaning |
---|---|

A << B | A dominates B |

A >> B | A is dominated by B |

A < B | A immediately dominates B |

A > B | A is immediately dominated by B |

A $ B | A is a sister of B (and not equal to B) |

A .. B | A precedes B |

A . B | A immediately precedes B |

A ,, B | A follows B |

A , B | A immediately follows B |

A <<, B | B is a leftmost descendant of A |

A <<- B | B is a rightmost descendant of A |

A >>, B | A is a leftmost descendant of B |

A >>- B | A is a rightmost descendant of B |

A <, B | B is the first child of A |

A >, B | A is the first child of B |

A <- B | B is the last child of A |

A >- B | A is the last child of B |

A <` B | B is the last child of A |

A >` B | A is the last child of B |

A <i B | B is the ith child of A (i > 0) |

A >i B | A is the ith child of B (i > 0) |

A <-i B | B is the ith-to-last child of A (i > 0) |

A >-i B | A is the ith-to-last child of B (i > 0) |

A <: B | B is the only child of A |

A >: B | A is the only child of B |

A <<: B | A dominates B via an unbroken chain (length > 0) of unary local trees. |

A >>: B | A is dominated by B via an unbroken chain (length > 0) of unary local trees. |

A $++ B | A is a left sister of B (same as $.. for context-free trees) |

A $– B | A is a right sister of B (same as $,, for context-free trees) |

A $+ B | A is the immediate left sister of B (same as $. for context-free trees) |

A $- B | A is the immediate right sister of B (same as $, for context-free trees) |

A $.. B | A is a sister of B and precedes B |

A $,, B | A is a sister of B and follows B |

A $. B | A is a sister of B and immediately precedes B |

A $, B | A is a sister of B and immediately follows B |

A <+(C) B | A dominates B via an unbroken chain of (zero or more) nodes matching description C |

A >+(C) B | A is dominated by B via an unbroken chain of (zero or more) nodes matching description C |

A .+(C) B | A precedes B via an unbroken chain of (zero or more) nodes matching description C |

A ,+(C) B | A follows B via an unbroken chain of (zero or more) nodes matching description C |

A <<# B | B is a head of phrase A |

A >># B | A is a head of phrase B |

A <# B | B is the immediate head of phrase A |

A ># B | A is the immediate head of phrase B |

A == B | A and B are the same node |

A <= B | A and B are the same node or A is the parent of B |

A : B | [this is a pattern-segmenting operator that places no constraints on the relationship between A and B] |

A <… { B ; C ; … } | A has exactly B, C, etc as its subtree, with no other children. |

Source: https://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/trees/tregex/TregexPattern.html

Advertisements