Successively sifts a word through the ADT induced by the given node. Stops when reaching a leaf.

@param word
the word to sift
@param subtree
the node whose subtree is considered

@return the leaf (see {@link ADTNode#sift(SymbolQueryOracle, Word)})
768662
public ADTNode<S, I, O> sift(final SymbolQueryOracle<I, O> oracle,
                                 final Word<I> word,
                                 final ADTNode<S, I, O> subtree) {

        ADTNode<S, I, O> current = subtree;

        while (!ADTUtil.isLeafNode(current)) {
            current = current.sift(oracle, word);
        }

        return current;
    }
1006868
@Nonnull
  public ExpressionTreeElement addSubTree(@Nonnull final ExpressionTree tree) {
    assertNotEmptySlot();

    final ExpressionTreeElement root = tree.getRoot();
    if (!root.isEmptySlot()) {
      root.makeMaxPriority();
      addElementToNextFreeSlot(root);
    }
    return this;
  }
596331
public String tag(final String word, final String postag) {
    // lookup postag as value of the map
    String newPosTag = this.dictMap.get(word.toLowerCase());
    if (newPosTag == null) {
      newPosTag = postag;
    }
    return newPosTag;
  }
1245971
public static boolean setAttribute(String word, CoreDictionary.Attribute attribute)
    {
        if (attribute == null) return false;

        if (CoreDictionary.trie.set(word, attribute)) return true;
        if (CustomDictionary.dat.set(word, attribute)) return true;
        if (CustomDictionary.trie == null)
        {
            CustomDictionary.add(word);
        }
        CustomDictionary.trie.put(word, attribute);
        return true;
    }
361439
@Override
    public Acceptance lookup(Word<? extends I> word) {
        State s = getState(word);
        if (s == null) {
            return Acceptance.DONT_KNOW;
        }
        return s.getAcceptance();
    }
525040
public boolean match(String word) {
        int flags = 0;
        if (ignoreCase) {
            flags = flags | Pattern.CASE_INSENSITIVE;
        }
        return Pattern.compile(pattern, flags).matcher(word).find();
    }
1158387
public int subtreeDepth() throws UnsupportedOperationException {
        String subtree=name;
        int i=1;

        /* strip off name@ portion */
        int atNdx = subtree.lastIndexOf('@');
        if (atNdx >= 0) {
            i++;
            subtree=subtree.substring(atNdx+1);
        }

        /* count dots in dnsname, adding one if dnsname preceded by @ */
        for (; subtree.lastIndexOf('.') >= 0; i++) {
            subtree=subtree.substring(0,subtree.lastIndexOf('.'));
        }

        return i;
    }
1214221
public Word<I> findSeparatingWord(final S s1, final S s2) {

        final FastMealyState<O> n1 = this.nodeToObservationMap.get(s1);
        final FastMealyState<O> n2 = this.nodeToObservationMap.get(s2);

        return NearLinearEquivalenceTest.findSeparatingWord(this.observationTree, n1, n2, this.alphabet, true);
    }
1294327
public static boolean add(String word)
    {
        if (HanLP.Config.Normalization) word = CharTable.convert(word);
        if (contains(word)) return false;
        return insert(word, null);
    }
843288
private String stringifySubTree(IntermediateQuery query, QueryNode subTreeRoot, String rootOffsetString) {
        StringBuilder strBuilder = new StringBuilder();
        strBuilder.append(rootOffsetString + subTreeRoot + "\n");

        for (QueryNode child : query.getChildren(subTreeRoot)) {
            strBuilder.append(stringifySubTree(query, child, rootOffsetString + TAB_STR));
        }
        return strBuilder.toString();
    }
399467
public static void remove(String key, String word) {

        SmartForest<List<String>> synonyms = get(key);

        SmartForest<List<String>> branch = synonyms.getBranch(word);

        if (branch == null || branch.getStatus() < 2) {
            return;
        }

        List<String> params = branch.getParam();

        synonyms.remove(word);
        branch.setParam(null);
        params.remove(word);

        if (params.size() == 1) { //如果是1 个也删除
            synonyms.remove(params.get(0));
            params.remove(0);
        } else {
            params.remove(word);
        }
    }
83055
private static NaryTree readSubtreeInPtbFormat(Reader reader) throws IOException {
        ReaderState state = ReaderState.START;
        StringBuilder symbolSb = new StringBuilder();
        ArrayList<NaryTree> children = null;
        boolean isLexical = false;

        char[] cbuf = new char[1];
        while (reader.read(cbuf) != -1) {
        //for (int i=0; i<treeStr.length(); i++) {
            //char c = treeStr.charAt(i);
            char c = cbuf[0];
            if (state == ReaderState.START) {
                if (c == '(') {
                    state = ReaderState.NONTERMINAL;
                } else if (c == ')') {
                    // This was the tail end of a tree.
                    break;
                } else if (!isWhitespace(c)) {
                    symbolSb.append(c);
                    state = ReaderState.LEXICAL;
                    isLexical = true;
                }
            } else if (state == ReaderState.LEXICAL) {
                if (isWhitespace(c) || c == ')') {
                    state = ReaderState.DONE;
                    break;
                } else {
                    symbolSb.append(c);
                }
            } else if (state == ReaderState.NONTERMINAL) {
                if (isWhitespace(c)) {
                    state = ReaderState.CHILDREN;
                    children = readTreesInPtbFormat(reader);
                    state = ReaderState.DONE;
                    break;
                } else {
                    symbolSb.append(c);
                }
            } else {
                throw new IllegalStateException("Invalid state: " + state);
            }
        }
        if (state != ReaderState.DONE) {
            // This reader did not start with a valid PTB style tree.
            return null;
        }
        
        int start = NOT_INITIALIZED;
        int end = NOT_INITIALIZED;
        String symbol = symbolSb.toString();
        NaryTree root = new NaryTree(symbol, start, end, children, isLexical);
        return root;
    }
375647
public static boolean is(String word){      
        if(word == null){
            return false;
        }
        word = word.trim();
        return isStopChar(word) || stopwords.contains(word);
    }
897876
def __get_node(self, word):
		

		node = self.root
		for c in word:
			try:
				node = node.children[c]
			except KeyError:
				return None

		return node
1251275
public List<Node> searchSubtree(Dn parent) throws NoSuchNodeException, MissingParentException {
        SearchCursor cursor = searchOneLevel(parent);
        return extractNodesFromCursor(cursor);
    }
439574
def extract_subtree(self, node):
        '''
        '''
        if not isinstance(node, Node):
            raise TypeError("node must be a Node")
        r = self.root; self.root = node; o = copy(self); self.root = r; return o
352277
public TreeNode getChildAt(int childIndex) {
		Entry e = catalog.getEntries().get(childIndex);
		return new EntryTreeNode(this, e, editors);
	}