Examples of reader()


Examples of com.digiburo.backprop1b.network.PatternList.reader()

    BpDemo3 bd3 = null;
    PatternList training = null;

    training = new PatternList();
    training.reader(new File(TRAIN_FILENAME));

    if (args.length == 0) {
      bd3 = new BpDemo3(new File(NETWORK_FILENAME));
    } else {
      bd3 = new BpDemo3(new File(args[0]));
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.reader()

        ObjectMapper mapper = new ObjectMapper(new FactoryWithSchema());
        MySchema s = new MySchema();
        StringReader r = new StringReader("{}");
        //  bit ugly, but can't think of cleaner simple way to check this...
        try {
            mapper.reader(s).withType(Object.class).readValue(r);
            fail("Excpected exception");
        } catch (SchemaException e) {
            assertSame(s, e._schema);
        }
    }
View Full Code Here

Examples of com.fasterxml.jackson.dataformat.csv.CsvMapper.reader()

        CsvMapper mapper = new CsvMapper();
        CsvSchema schema = CsvSchema.builder()
            .setUseHeader(true)
            .build();

        MappingIterator<T> it = mapper.reader(cls)
            .with(schema).readValues(inputFile);
        while (it.hasNext()) {
            @SuppressWarnings("unused")
            T row = it.nextValue();
            ++count;
View Full Code Here

Examples of com.fasterxml.jackson.dataformat.xml.XmlMapper.reader()

        }

        // and then try reading back
        JavaType resListType = xmlMapper.getTypeFactory()
                .constructCollectionType(List.class, SampleResource.class);
        Object ob = xmlMapper.reader(resListType).readValue(xml);
        assertNotNull(ob);

//      System.err.println("XML -> "+xmlMapper.writerWithDefaultPrettyPrinter().writeValueAsString(ob));
       
        assertTrue(ob instanceof List);
View Full Code Here

Examples of com.google.caliper.runner.ServerSocketService.OpenedSocket.reader()

              logger.fine("successfully opened the pipe from the worker");
              socketWriter = openedSocket.writer();
              runningReadStreams.addAndGet(1);
              openStreams.addAndGet(1);
              streamExecutor.submit(threadRenaming("worker-socket",
                  new StreamReader(openedSocket.reader())));
            } catch (ExecutionException e) {
              notifyFailed(e.getCause());
            } catch (InterruptedException e) {
              throw new AssertionError("impossible, future is already done.");
            }
View Full Code Here

Examples of edu.stanford.nlp.tagger.io.TaggedFileRecord.reader()

      OutputStyle outputStyle = OutputStyle.fromShortName(config.getOutputFormat());
      if (!stdin) {
        String filename = config.getFile();
        if (formatPattern.matcher(filename).find()) {
          TaggedFileRecord record = TaggedFileRecord.createRecord(config, filename);
          runTagger(record.reader(), writer, outputStyle);
        } else {
          br = IOUtils.readerFromString(config.getFile(), config.getEncoding());
          runTagger(br, writer, config.getTagInside(), outputStyle);
        }
      } else {
View Full Code Here

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

        while (docIter.hasNext()) {
            long startTime = System.currentTimeMillis();
            Document doc = docIter.next();
            int docNumber = ++count;
            int terms = 0;
            sspace.processDocument(doc.reader());
            long endTime = System.currentTimeMillis();
            verbose("processed document #%d in %.3f seconds",
                    docNumber, ((endTime - startTime) / 1000d));
        }
View Full Code Here

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

                        long startTime = System.currentTimeMillis();
                        Document doc = docIter.next();
                        int docNumber = count.incrementAndGet();
                        int terms = 0;
                        try {
                            sspace.processDocument(doc.reader());
                        } catch (Throwable t) {
                            t.printStackTrace();
                        }
                        long endTime = System.currentTimeMillis();
                        verbose("parsed document #%d in %.3f seconds",
View Full Code Here

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

    }

    @Test public void testSingleExtraction() throws Exception {
        DependencyExtractor extractor = new CoNLLDependencyExtractor();
        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()

        DependencyExtractor extractor = new CoNLLDependencyExtractor();
        Document doc = new StringDocument("\n\n" +
                                          toTabs(SINGLE_PARSE) +
                                          "\n" +
                                          toTabs(SECOND_PARSE));
        BufferedReader reader = doc.reader();
        DependencyTreeNode[] relations = extractor.readNextTree(reader);
        assertTrue(relations != null);
        assertEquals(12, relations.length);

        testFirstRoot(relations, 2);
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.