Examples of reader()


Examples of edu.ucla.sspace.text.Document.reader()

    }
   
    @Test public void testRootNode() throws Exception {
        DependencyExtractor extractor = new CoNLLDependencyExtractor();
        Document doc = new StringDocument(toTabs(SINGLE_PARSE));
        DependencyTreeNode[] relations = extractor.readNextTree(doc.reader());

        assertEquals(12, relations.length);

        testFirstRoot(relations, 2);
    }
View Full Code Here

Examples of edu.ucla.sspace.text.Document.reader()

    }

    @Test public void testConcatonatedTrees() throws Exception {
        DependencyExtractor extractor = new CoNLLDependencyExtractor();
        Document doc = new StringDocument(toTabs(CONCATONATED_PARSE));
        DependencyTreeNode[] relations = extractor.readNextTree(doc.reader());
       
        assertEquals(16, relations.length);
        testFirstRoot(relations, 2);
        testSecondRoot(relations, 13);
    }
View Full Code Here

Examples of edu.ucla.sspace.text.Document.reader()

    }

    @Test public void testConcatonatedTreesZeroOffset() throws Exception {
        DependencyExtractor extractor = new CoNLLDependencyExtractor();
        Document doc = new StringDocument(toTabs(DOUBLE_ZERO_OFFSET_PARSE));
        DependencyTreeNode[] relations = extractor.readNextTree(doc.reader());
       
        assertEquals(16, relations.length);
        testFirstRoot(relations, 2);
        testSecondRoot(relations, 13);
    }
View Full Code Here

Examples of edu.ucla.sspace.text.Document.reader()

        "arbetsinkomster _   NN  3  3   PA  _   _\n";
    @Test public void testSingleExtraction() throws Exception {
        DependencyExtractor extractor = new WaCKyDependencyExtractor();
        Document doc = new StringDocument(toTabs(SINGLE_PARSE));
        DependencyTreeNode[] nodes = extractor.readNextTree(doc.reader());

        assertEquals(12, nodes.length);

        // Check the basics of the node.
        assertEquals("review", nodes[8].word());
View Full Code Here

Examples of edu.ucla.sspace.text.Document.reader()

    }

    @Test public void testDoubleExtraction() throws Exception {
        DependencyExtractor extractor = new WaCKyDependencyExtractor();
        Document doc = new StringDocument(toTabs(DOUBLE_PARSE));
        BufferedReader reader = doc.reader();
        DependencyTreeNode[] relations = extractor.readNextTree(reader);
        assertTrue(relations != null);
        assertEquals(12, relations.length);

        testFirstRoot(relations, 2);
View Full Code Here

Examples of edu.ucla.sspace.text.Document.reader()

    }
   
    @Test public void testRootNode() throws Exception {
        DependencyExtractor extractor = new WaCKyDependencyExtractor();
        Document doc = new StringDocument(toTabs(SINGLE_PARSE));
        DependencyTreeNode[] relations = extractor.readNextTree(doc.reader());

        assertEquals(12, relations.length);

        testFirstRoot(relations, 2);
    }
View Full Code Here

Examples of edu.ucla.sspace.text.Document.reader()

    }

    @Test public void testConcatonatedTrees() throws Exception {
        DependencyExtractor extractor = new WaCKyDependencyExtractor();
        Document doc = new StringDocument(toTabs(CONCATONATED_PARSE));
        DependencyTreeNode[] relations = extractor.readNextTree(doc.reader());
       
        assertEquals(16, relations.length);
        testFirstRoot(relations, 2);
        testSecondRoot(relations, 13);
    }
View Full Code Here

Examples of edu.ucla.sspace.text.Document.reader()

    }

    @Test public void testConcatonatedTreesZeroOffset() throws Exception {
        DependencyExtractor extractor = new WaCKyDependencyExtractor();
        Document doc = new StringDocument(toTabs(DOUBLE_ZERO_OFFSET_PARSE));
        DependencyTreeNode[] relations = extractor.readNextTree(doc.reader());
       
        assertEquals(16, relations.length);
        testFirstRoot(relations, 2);
        testSecondRoot(relations, 13);
    }
View Full Code Here

Examples of edu.ucla.sspace.text.Document.reader()

     */
    private void process(Iterator<Document> docs) throws IOException {
        long numTokens = 0;
        while (docs.hasNext()) {
            Document doc = docs.next();
            DependencyTreeNode[] nodes = extractor.readNextTree(doc.reader());
            for (DependencyTreeNode node : nodes) {
                String token = node.word();
                if (doLowerCasing)
                    token = token.toLowerCase();
                if (doPos)
View Full Code Here

Examples of edu.ucla.sspace.text.Document.reader()

            int docNum = 0;
            long startTime = System.currentTimeMillis();
            Iterator<Document> docs = getDocuments(options);
            while (docs.hasNext()) {
                Document doc = docs.next();
                Iterator<String> tokens = new WordIterator(doc.reader());
                String t1 = null;
                while (tokens.hasNext()) {
                    String t2 = tokens.next();
                    // Count the occurrence of this token if we're supposed to
                    // record it
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.