internal TregexMatcher(Tree root, Tree tree, IdentityHashMap <Tree, Tree> nodesToParents, IDictionary <string, Tree> namesToNodes, VariableStrings variableStrings, IHeadFinder headFinder) { // these things are used by "find" this.root = root; this.tree = tree; this.nodesToParents = nodesToParents; this.namesToNodes = namesToNodes; this.variableStrings = variableStrings; this.headFinder = headFinder; }
public DescriptionMatcher(DescriptionPattern n, Tree root, Tree tree, IdentityHashMap <Tree, Tree> nodesToParents, IDictionary <string, Tree> namesToNodes, VariableStrings variableStrings, IHeadFinder headFinder) : base(root, tree, nodesToParents, namesToNodes, variableStrings, headFinder) { // TODO: Why is this a static class with a pointer to the containing // class? There seems to be no reason for such a thing. // cdm: agree: It seems like it should just be a non-static inner class. Try this and check it works.... // a DescriptionMatcher only has a single child; if it is the left // side of multiple relations, a CoordinationMatcher is used. // childMatcher is null until the first time a matcher needs to check the child // myNode.child == null OR resetChild has never been called // the Tree node that this DescriptionMatcher node is trying to match on. // when finished = true, it means I have exhausted my potential tree node match candidates. myNode = n; }
internal override TregexMatcher Matcher(Tree root, Tree tree, IdentityHashMap <Tree, Tree> nodesToParents, IDictionary <string, Tree> namesToNodes, VariableStrings variableStrings, IHeadFinder headFinder) { return(new DescriptionPattern.DescriptionMatcher(this, root, tree, nodesToParents, namesToNodes, variableStrings, headFinder)); }
public CoordinationMatcher(CoordinationPattern n, Tree root, Tree tree, IdentityHashMap <Tree, Tree> nodesToParents, IDictionary <string, Tree> namesToNodes, VariableStrings variableStrings, IHeadFinder headFinder) : base(root, tree, nodesToParents, namesToNodes, variableStrings, headFinder) { // do all con/dis-juncts have to be considered to determine a match? // i.e. true if conj and not negated or disj and negated myNode = n; children = new TregexMatcher[myNode.children.Count]; // lazy initialize the children... don't set children[i] yet //for (int i = 0; i < children.length; i++) { // TregexPattern node = myNode.children.get(i); // children[i] = node.matcher(root, tree, nodesToParents, // namesToNodes, variableStrings); //} currChild = 0; considerAll = myNode.isConj ^ myNode.IsNegated(); }