![]() -o Specifies that each tree node can be reported only once as the root of a match (by default a node willīe printed once for every way the pattern matches).Don't specify a pattern when this option is used. -i causes the pattern to be matched to be read from rather than the command line.-W causes the whole of a tree that matches to be printed ALSO.-w causes ONLY the whole of a tree that matches to be printed.-C suppresses printing of matches, so only the.If this is a directory, there will be recursive descent and the pattern will be run on all files beneath the specified directory. filepath: the path to files with trees.Pattern which optionally names some set of nodes (i.e., gives it the "handle") =name (for some arbitrary Java .tregex.TregexPattern ]* pattern filepath Prints out all matches of a tree pattern on each tree in the path. (.*)(.*)/#1%foo#2%bar, but that will not work.Īuthor: Galen Andrew, Roger Levy Anna Rafferty (filter mode), John Bauer (extensively tested and bugfixed) See Also: Serialized Form That matches the concatenation of these patterns, Using multiple variable strings in one regex may not.ForĮxample, the pattern A | B will not work. Tregex does not support disjunctions at the root level.Will match only such that the WH- node under the SBAR is coindexed with the trace node that gets the name empty. This is useful for enforcing coindexation constraints. If more than one node has a group assigned to the same variable name, then matching will only occur when all such groupsĬapture the same string. If you write a node description using a regular expression, you can assign its matching groups to variable names. The Function mapping from labels to Basic Category tags can be Operator is omitted in a chain of relations, so that the two patterns are equivalent: Also note that & is the default combining operator if the Withoutīrackets, & takes precedence over |, and equivalent operators are Matches an NP that (1) dominates either an NN or an NNS, and (2) is under an S. Relations can be grouped using brackets ''. Matches, then variable b will not be assigned even if ForĮxample, if the pattern is NP=a | NNP=b and the NP Is both under an S and has a VP as a right sister.Įxpressions stop evaluating as soon as the result is known. ![]() +(C) B A precedes B via an unbroken chain of (zero or more) nodes matching description CĪ ,+(C) B A follows B via an unbroken chain of (zero or more) nodes matching description CĪ # B A is the immediate head of phrase B B A is a sister of B and immediately precedes BĪ $, B A is a sister of B and immediately follows BĪ +(C) B A is dominated by B via an unbroken chain of (zero or more) nodes matching description CĪ. for context-free trees)Ī $- B A is the immediate right sister of B (same as $, for context-free trees)Ī $. for context-free trees)Ī $- B A is a right sister of B (same as $, for context-free trees)Ī $+ B A is the immediate left sister of B (same as $. The pattern is: /^MW/ > B A is dominated by BĪ >-i B A is the ith-to-last child of B (i > 0)Ī >: B A is dominated by B via an unbroken chain (length > 0) of unary local trees.Ī $++ B A is a left sister of B (same as $. Want to match anything starting with MW, we use a regular expression patternįor the top node and then also check for the child. The first thing to do is figure out what pattern to use. That is, we want any subtree whose root is labeled MWV, MWN, etc. ![]() The root of the subtree starts with MW and it has a child node with the label IN. Suppose we want to find all examples of subtrees where the label of The main() method can be used to find matching nodes of a treebank from the command line. TregexPattern instances can be matched against instances of the Tree class. ![]() To an arbitrary set of trees at runtime in a processing pipeline without pre-indexing. Rather there is a linear scan through the trees where matches are sought.Īs a result, matching is slower, but a TregexPattern can be applied Tree pattern matching systems, but like Unix grep, there is no pre-indexing of the data to be searched. The tree pattern languages pioneered by tgrep and tgrep2. The Tregex language follows but slightly expands A TregexPattern is a regular expression-like pattern that is designed to match node configurations withinĪ Tree where the nodes are labeled with symbols, rather than a character string. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |