File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/edu/stanford/nlp/semgraph/semgrex Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 229229 * This is only legal on relations with only one link between the two endpoints.
230230 * Other relations (such as grandparent) will throw a parse exception.
231231 *
232+ * <h3>Variable Groups</h3>
233+ *
234+ * If you write a node description using a regular expression, you can
235+ * assign its matching groups to variable names. If more than one node
236+ * has a group assigned to the same variable name, then matching will
237+ * only occur when all such groups capture the same string. This is
238+ * useful for enforcing coindexation constraints. The syntax is
239+ *
240+ * {@code / <regex-stuff> /#<group-number>%<variable-name> }
241+ *
242+ * For example, a pattern which looks for the same word occurring twice in a row is
243+ *
244+ * {@code {word:__#1%w} . {word:__#1%w}}
245+ *
232246 * <h3>TODO</h3>
233247 * At present a Semgrex pattern will match only once at a root node, even if there is more than one way of satisfying
234248 * it under the root node. Probably its semantics should be changed, or at least the option should be given, to return
You can’t perform that action at this time.
0 commit comments