Traverse trie node.

@param str the str
@return the trie node
3205
public TrieNode traverse(String str) {
    if (str.isEmpty()) {
      return this;
    }
    return getChild(str.charAt(0)).map(n -> n.traverse(str.substring(1))).orElse(this);
  }
1071539
def rewrite_str_with_trie(sval, trie, boundaries = False, slow = False):
    '''
    
    '''
    if boundaries:
        sval = fsed.ahocorasick.boundary_transform(sval)
    if slow:
        sval = trie.replace(sval)
    else:
        sval = trie.greedy_replace(sval)
    if boundaries:
        sval = ''.join(fsed.ahocorasick.boundary_untransform(sval))
    return sval
272031
private void traverse(GroovySourceAST t) {
        if (t == null) { return; }
        if (unvisitedNodes != null) {
           unvisitedNodes.add(t);
        }
        GroovySourceAST child = (GroovySourceAST)t.getFirstChild();
        if (child != null) {
            traverse(child);
        }
        GroovySourceAST sibling = (GroovySourceAST)t.getNextSibling();
        if (sibling != null) {
            traverse(sibling);
        }
    }
215770
function findNodeWithFirstChar(nodeList, char) {
    return [...nodeList].findIndex((el) => el.innerText.charAt(0).toLowerCase() === char.toLowerCase());
}
422112
@Override
	public void traverse(final ITreeNode<T> node, final List<ITreeNode<T>> list)
	{
		list.add(node);
		for (final ITreeNode<T> data : node.getChildren())
		{
			traverse(data, list);
		}
	}
1262530
public static String getTypeString(String str) {
		CharType[] tag = getType(str);
		String s = type2String(tag);		
		return s;
	}
486166
public void traverse(int pos) throws org.xml.sax.SAXException
  {
    m_dtm = m_transformer.getXPathContext().getDTM(pos);
    m_startNode = pos;

    super.traverse(pos);
  }
749435
public void removeString(String str)
    {
        if (sourceNode != null)
        {
            //Split the _transition path corresponding to str to ensure that
            //any other _transition paths sharing nodes with it are not affected
            splitTransitionPath(sourceNode, str);

            //Remove from equivalenceClassMDAGNodeHashMap, the entries of all the nodes in the _transition path corresponding to str.
            removeTransitionPathRegisterEntries(str);

            //Get the last node in the _transition path corresponding to str
            MDAGNode strEndNode = sourceNode.transition(str);
            if (strEndNode == null) return;

            if (!strEndNode.hasTransitions())
            {
                int soleInternalTransitionPathLength = calculateSoleTransitionPathLength(str);
                int internalTransitionPathLength = str.length() - 1;

                if (soleInternalTransitionPathLength == internalTransitionPathLength)
                {
                    sourceNode.removeOutgoingTransition(str.charAt(0));
                    transitionCount -= str.length();
                }
                else
                {
                    //Remove the sub-path in str's _transition path that is only used by str
                    int toBeRemovedTransitionLabelCharIndex = (internalTransitionPathLength - soleInternalTransitionPathLength);
                    MDAGNode latestNonSoloTransitionPathNode = sourceNode.transition(str.substring(0, toBeRemovedTransitionLabelCharIndex));
                    latestNonSoloTransitionPathNode.removeOutgoingTransition(str.charAt(toBeRemovedTransitionLabelCharIndex));
                    transitionCount -= str.substring(toBeRemovedTransitionLabelCharIndex).length();
                    /////

                    replaceOrRegister(sourceNode, str.substring(0, toBeRemovedTransitionLabelCharIndex));
                }

            }
            else
            {
                strEndNode.setAcceptStateStatus(false);
                replaceOrRegister(sourceNode, str);
            }
        }
        else
        {
            unSimplify();
        }
    }
1002953
def traverse(self, node):
    
    self.find_and_replace(node)

    for c in node.children:
      self.traverse(c)
1262429
public TrieNode traverse(long cursorId) {
    if (!containsCursor(cursorId)) {
      throw new IllegalArgumentException();
    }
    return getChildren().filter(n -> n.containsCursor(cursorId)).findFirst().map(n -> n.traverse(cursorId))
      .orElse(this);
  }
105835
QNode traversalHead() {
    for (;;) {
      QNode t = this.tail.get();
      QNode h = this.head.get();
      if (h != null && t != null) {
        QNode last = t.next;
        QNode first = h.next;
        if (t == this.tail.get()) {
          if (last != null) {
            this.tail.compareAndSet(t, last);
          } else if (first != null) {
            Object x = first.get();
            if (x == first) {
              advanceHead(h, first);
            } else {
              return h;
            }
          } else {
            return h;
          }
        }
      }
    }
  }
1061855
public org.w3c.dom.Node readNode()
        throws IOException
    {
        int tag = read();

        switch (tag) {
            case 'N':
                return null;

            case 'S':
            case 's':
            case 'X':
            case 'x':
                _isLastChunk = tag == 'S' || tag == 'X';
                _chunkLength = (read() << 8) + read();

                throw error("Can't handle string in this context");

            default:
                throw expect("string", tag);
        }
    }
1310236
private int nextXpathNodeSeperator() {
        int start = pos;
        boolean inQuote = false;
        char last = 0;
        do {
            if (queue.length() - start == 0) {
                return -1;
            }
            Character c = queue.charAt(start++);

            if (last == 0 || last != ESC) {
                if ((c.equals('\'') || c.equals('"')))
                    inQuote = !inQuote;
                if (inQuote)
                    continue;
            }

            if (c == '/') {
                return start;
            }

            last = c;
        } while (true);
    }
152420
public static function parse_attrib_string($str)
    {
        $attrib = array();
        $html   = '<html>'
            . '<head><meta http-equiv="Content-Type" content="text/html; charset=' . RCUBE_CHARSET . '" /></head>'
            . '<body><div ' . rtrim($str, '/ ') . ' /></body>'
            . '</html>';

        $document = new DOMDocument('1.0', RCUBE_CHARSET);
        @$document->loadHTML($html);

        if ($node = $document->getElementsByTagName('div')->item(0)) {
            foreach ($node->attributes as $name => $attr) {
                $attrib[strtolower($name)] = $attr->nodeValue;
            }
        }

        return $attrib;
    }
964247
public Node<T> getNext(int value) {
    	if (value == last.value) return null;
    	if (value == root.value) {
    		if (root.right == null) return null;
    		Node<T> n = root.right;
    		while (n.left != null) n = n.left;
    		return n;
    	}
    	if (value > root.value) {
    		if (root.right == null) return null;
    		return getNext(root.right, value);
    	}
    	if (root.left == null) return null;
    	return getNext(root, root.left, value);
    }
457197
public List<RETemplate> getTemplate(String str){

		List<RETemplate> templates = new ArrayList<RETemplate>();
		Iterator<RETemplate> it = group.iterator();
		while(it.hasNext()){
			RETemplate qt = it.next();
			float w = qt.matches(str);
			if(w>0)
				templates.add(qt);
		}
		return templates;
	}
640972
function traverse(node, callback) {
    callback(node);
    for (var i = 0, cn = node.childNodes, len = cn.length; i < len; i++) {
        var childNode = cn[i];
        if (childNode.tagName) {
            traverse(childNode, callback);
        }
    }
}