Examples of firstChild()


Examples of edu.stanford.nlp.trees.Tree.firstChild()

    // a couple of other random errors are corrected here
    for (Tree subtree : newTree) {
      if (subtree.value().equals("CP") && subtree.numChildren() == 1) {
        Tree subsubtree = subtree.firstChild();
        if (subsubtree.value().equals("ROOT")) {
          if (subsubtree.firstChild().isLeaf() && "CP".equals(subsubtree.firstChild().value())) {
            EncodingPrintWriter.err.println("Correcting error: seriously messed up tree in CTB6: " + newTree, ChineseTreebankLanguagePack.ENCODING);
            List<Tree> children = subsubtree.getChildrenAsList();
            children = children.subList(1,children.size());
            subtree.setChildren(children);
            EncodingPrintWriter.err.println("  Corrected as:                                     " + newTree, ChineseTreebankLanguagePack.ENCODING); // spaced to align with above
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.firstChild()

    // a couple of other random errors are corrected here
    for (Tree subtree : newTree) {
      if (subtree.value().equals("CP") && subtree.numChildren() == 1) {
        Tree subsubtree = subtree.firstChild();
        if (subsubtree.value().equals("ROOT")) {
          if (subsubtree.firstChild().isLeaf() && "CP".equals(subsubtree.firstChild().value())) {
            EncodingPrintWriter.err.println("Correcting error: seriously messed up tree in CTB6: " + newTree, ChineseTreebankLanguagePack.ENCODING);
            List<Tree> children = subsubtree.getChildrenAsList();
            children = children.subList(1,children.size());
            subtree.setChildren(children);
            EncodingPrintWriter.err.println("  Corrected as:                                     " + newTree, ChineseTreebankLanguagePack.ENCODING); // spaced to align with above
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.firstChild()

//  }

  @Override
  public Tree readTree() throws IOException {
    Tree tr = super.readTree();
    while (tr != null && tr.firstChild().value().equals("FRAG")) {
//      if (pw != null) {
//        pw.println("Discarding Tree:");
//        tr.pennPrint(pw);
//      }
      tr = super.readTree();
View Full Code Here

Examples of org.w3c.dom.traversal.TreeWalker.firstChild()

        Element root = null;

        // Using TreeWalker
        DocumentTraversal travDoc = (DocumentTraversal)doc;
        TreeWalker walker = travDoc.createTreeWalker(root,NodeFilter.SHOW_ELEMENT,null,true);
        Element child = (Element)walker.firstChild();
        while(child != null)
        {
            // Do something with child ...
            child = (Element)walker.nextSibling();
        }
View Full Code Here

Examples of org.w3c.dom.traversal.TreeWalker.firstChild()

    public static void BASIC_DOM_UTILITIES_2()
    {
        Element root = null;
        TreeWalker walker = null;

        Element child = (Element)walker.firstChild();
        if (child != null)
        {
            while(child != null)
            {
                // Do something with child ...
View Full Code Here

Examples of xbird.xquery.dm.dtm.IDocumentTable.firstChild()

        final IDocumentTable doctbl = _store;
        doctbl.ensureOpen();
        switch(doctbl.getNodeKindAt(nodeid)) {
            case NodeKind.DOCUMENT:
                receiver.evStartDocument();
                final long firstChild = doctbl.firstChild(nodeid);
                if(firstChild != -1L) {
                    export(firstChild, receiver);
                    long nextSib = doctbl.nextSibling(firstChild);
                    while(nextSib != 0L) {
                        export(nextSib, receiver);
View Full Code Here

Examples of xbird.xquery.dm.dtm.IDocumentTable.firstChild()

                    final long attid = doctbl.getAttribute(nodeid, i);
                    final QualifiedName attName = doctbl.getAttributeName(attid);
                    final String attValue = doctbl.getText(attid);
                    receiver.evAttribute(attid, attName, attValue);
                }
                final long elemFirstChild = doctbl.firstChild(nodeid);
                if(elemFirstChild != -1L) {
                    export(elemFirstChild, receiver);
                    long nextSib = doctbl.nextSibling(elemFirstChild);
                    while(nextSib != 0L) {
                        export(nextSib, receiver);
View Full Code Here

Examples of xbird.xquery.dm.dtm.IDocumentTable.firstChild()

        }

        @Override
        public DTMNodeBase firstChild() {
            final IDocumentTable store = documentTable();
            final long cid = store.firstChild(_id);
            if(cid == -1) {
                return null;
            }
            final DocumentTableModel model = getDataModel();
            return model.createNode(store.getNodeKindAt(cid), cid);
View Full Code Here

Examples of xbird.xquery.dm.dtm.IDocumentTable.firstChild()

        }
        final IDocumentTable doctbl = _store;
        switch(doctbl.getNodeKindAt(nodeid)) {
            case NodeKind.DOCUMENT:
                receiver.evStartDocument();
                final long firstChild = doctbl.firstChild(nodeid);
                if(firstChild != -1L) {
                    export(firstChild, receiver);
                    long nextSib = doctbl.nextSibling(firstChild);
                    while(nextSib != 0L) {
                        export(nextSib, receiver);
View Full Code Here

Examples of xbird.xquery.dm.dtm.IDocumentTable.firstChild()

                    final long attid = doctbl.getAttribute(nodeid, i);
                    final QualifiedName attName = doctbl.getAttributeName(attid);
                    final String attValue = doctbl.getText(attid);
                    receiver.evAttribute(attid, attName, attValue);
                }
                final long elemFirstChild = doctbl.firstChild(nodeid);
                if(elemFirstChild != -1L) {
                    export(elemFirstChild, receiver);
                    long nextSib = doctbl.nextSibling(elemFirstChild);
                    while(nextSib != 0L) {
                        export(nextSib, receiver);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.