Adds leaf nodes begin with prefix to this tree.
166847
def AddLeafNodes(self, prefix, node):
    """"""
    if not node:
      self.AddPath(prefix)
    for name in node:
      child_path = prefix + '.' + name
      self.AddLeafNodes(child_path, node[name])
446067
function addWord(word) {

    var branch = this.root;
    var stopSearchOnCurrentBranch = false;
    var newNode;

    while (!stopSearchOnCurrentBranch) {
      var wordContainsThePrefix = false;
      var isCase3 = false;
      var case2Result;

      //Looks for how branch it should follow
      for (var b in branch.branches) {

        //Case 1: current node prefix == `word`
        if(this._tryCase1(branch, word, b)) {
          return;
        }

        //Case 2: `word` begins with current node prefix to add
        //Cuts the word and goes to the next branch
        case2Result = this._tryCase2(branch, word, b);
        if(case2Result) {
          word = case2Result.word;
          branch = case2Result.branch;
          wordContainsThePrefix = true;
          break;
        }

        //Case 3: current node prefix begins with part of or whole `word`
        if(this._tryCase3(branch, word, b)) {
          isCase3 = stopSearchOnCurrentBranch = wordContainsThePrefix = true;
          break;
        }
      }

      //Case 4: current node prefix doesn't have intersection with `word`
      if(this._tryCase4(branch, word, wordContainsThePrefix)) {
        stopSearchOnCurrentBranch = true;
      }
    }
  }
313053
protected void addContainerTags() {
	// Only add root if we aren't it
	final RootContainer rc = getRootContainer(container);
	if (rc != null) {
	    tags.add(rc);
	}

	final TreeDepth parentDepth = getTreeDepth(container);
	tags.add(parentDepth != null ? parentDepth.increment() : TreeDepth.ROOT);
    }
153052
def add_adjust(self, data, prehashed=False):
        
        subtrees = self._get_whole_subtrees()
        new_node = Node(data, prehashed=prehashed)
        self.leaves.append(new_node)
        for node in reversed(subtrees):
            new_parent = Node(node.val + new_node.val)
            node.p, new_node.p = new_parent, new_parent
            new_parent.l, new_parent.r = node, new_node
            node.sib, new_node.sib = new_node, node
            node.side, new_node.side = 'L', 'R'
            new_node = new_node.p
        self.root = new_node
949160
public Node addNode(Node subNode) {
		if (this instanceof Node) {
			subNode.parentNode = (Node) this;
		}
		contents.add(subNode);
		return subNode;
	}
127208
def add_child(self, node):
        """"""
        node._parent = self
        self._children.append(node)
67833
private void addChildElements() {
		for (Node node : nodes) {
			Collection<? extends Node> childNodes = helper.getChildNodes(node);
			for (Node child : childNodes)
				if (matchTag(child))
					result.add(child);
		}
	}
696210
def add(self, node):
        
        self.sons.append(node)
        node.parent = self
450809
private void addTMP9(final Tree tree) {
    // do the head chain under it
    Tree ht = headFinder.determineHead(tree);
    // special fix for possessives! -- make noun before head
    if (ht.value().equals("POS")) {
      int j = tree.indexOf(ht);
      if (j > 0) {
        ht = tree.getChild(j - 1);
      }
    }
    // Note: this next bit changes the tree label, rather
    // than creating a new tree node.  Beware!
    if (ht.isPreTerminal() || ht.value().startsWith("NP") ||
        ht.value().startsWith("PP") || ht.value().startsWith("ADVP")) {
      if (!TmpPattern.matcher(ht.value()).matches()) {
        LabelFactory lf = ht.labelFactory();
        // System.err.println("TMP: Changing " + ht.value() + " to " +
        //                   ht.value() + "-TMP");
        ht.setLabel(lf.newLabel(ht.value() + "-TMP"));
      }
      if (ht.value().startsWith("NP") || ht.value().startsWith("PP") ||
          ht.value().startsWith("ADVP")) {
        addTMP9(ht);
      }
    }
    // do the NPs under it (which may or may not be the head chain
    Tree[] kidlets = tree.children();
    for (int k = 0; k < kidlets.length; k++) {
      ht = kidlets[k];
      LabelFactory lf;
      if (tree.isPrePreTerminal() && !TmpPattern.matcher(ht.value()).matches()) {
        // System.err.println("TMP: Changing " + ht.value() + " to " +
        //                   ht.value() + "-TMP");
        lf = ht.labelFactory();
        // Note: this next bit changes the tree label, rather
        // than creating a new tree node.  Beware!
        ht.setLabel(lf.newLabel(ht.value() + "-TMP"));
      } else if (ht.value().startsWith("NP")) {
        // don't add -TMP twice!
        if (!TmpPattern.matcher(ht.value()).matches()) {
          lf = ht.labelFactory();
          // System.err.println("TMP: Changing " + ht.value() + " to " +
          //                   ht.value() + "-TMP");
          // Note: this next bit changes the tree label, rather
          // than creating a new tree node.  Beware!
          ht.setLabel(lf.newLabel(ht.value() + "-TMP"));
        }
        addTMP9(ht);
      }
    }
  }
492557
def _AddFieldPaths(node, prefix, field_mask):
  """"""
  if not node:
    field_mask.paths.append(prefix)
    return
  for name in sorted(node):
    if prefix:
      child_path = prefix + '.' + name
    else:
      child_path = name
    _AddFieldPaths(node[name], child_path, field_mask)
258514
void addRightLeaf(
    Object            new1)
  {
    GBSNode  p = _index.getNode(new1);
    if (rightChild() != null)
      throw new RuntimeException("Help!");
    setRightChild(p);
  }
1306275
def add_root(cls, **kwargs):
        """"""

        # do we have a root node already?
        last_root = cls.get_last_root_node()

        if last_root and last_root.node_order_by:
            # there are root nodes and node_order_by has been set
            # delegate sorted insertion to add_sibling
            return last_root.add_sibling('sorted-sibling', **kwargs)

        if last_root:
            # adding the new root node as the last one
            newtree_id = last_root.tree_id + 1
        else:
            # adding the first root node
            newtree_id = 1

        if len(kwargs) == 1 and 'instance' in kwargs:
            # adding the passed (unsaved) instance to the tree
            newobj = kwargs['instance']
            if newobj.pk:
                raise NodeAlreadySaved("Attempted to add a tree node that is "\
                    "already in the database")
        else:
            # creating the new object
            newobj = get_result_class(cls)(**kwargs)

        newobj.depth = 1
        newobj.tree_id = newtree_id
        newobj.lft = 1
        newobj.rgt = 2
        # saving the instance before returning it
        newobj.save()
        return newobj
341666
protected synchronized void addPrefix(final String prefixString) {
		if (prefixString != null) {
			final Set<String> prefixes = getPrefixes();
			prefixes.add(prefixString);
			setPrefixes(prefixes);
		}
	}
1254323
private void addFirstOfType() {
        for (Node node : nodes) {
            Node n = DOMHelper.getPreviousSiblingElement(node);
            while (n != null) {
                if (DOMHelper.getNodeName(n).equals(DOMHelper.getNodeName(node))) {
                    break;
                }
                
                n = DOMHelper.getPreviousSiblingElement(n);
            }
            
            if (n == null) {
                result.add(node);
            }
        }
    }
35662
def addNode(self, node):
        '''
        
        '''
        self.mybldgbuids[node.buid] = node
        self.allbldgbuids[node.buid] = (node, self.doneevent)
1284925
private void addLeafLabel() {
        final int nodeKind = mRtx.getNode().getKind();
        if (!mLeafLabels.containsKey(nodeKind)) {
            mLeafLabels.put(nodeKind, new ArrayList<ITreeData>());
        }
        mLeafLabels.get(nodeKind).add(mRtx.getNode());
    }
419822
private void addFirstChildElements() {
        for (Node node : nodes) {
            if (DOMHelper.getPreviousSiblingElement(node) == null) {
                result.add(node);
            }
        }
    }