Examples of LineReader


Examples of com.clearnlp.reader.LineReader

    String type = UTXml.getTrimmedAttribute(eReader, TAG_TYPE);
   
    if      (type.equals(AbstractReader.TYPE_RAW))
      return new RawReader();
    else if (type.equals(AbstractReader.TYPE_LINE))
      return new LineReader();
    else
      return getJointReader(eReader);
  }
View Full Code Here

Examples of com.google.common.io.LineReader

    generator = mapper.getJsonFactory().createJsonGenerator(new File(OUTPUT_FILE), JsonEncoding.UTF8);
  }

  public void process() throws IOException {
    final FileReader fileReader = new FileReader(new File(INPUT_FILE));
    final LineReader reader = new LineReader(fileReader);
    try {
      JsonNode obj;
      String line;
      while ((line = reader.readLine()) != null) {
        obj = mapper.readTree(line);
        this.convertRatedOutputCurrent(obj);
        this.convertRatedOutputVoltage(obj);
        this.convertRatedOutputkW(obj);
        this.convertLatitude(obj);
View Full Code Here

Examples of com.google.common.io.LineReader

   * JSON object, add it to the index, and commit the documents at the end of
   * the process.
   */
  public void index(final File input) throws IOException, SolrServerException {
    logger.info("Loading JSON objects from {}", input);
    final LineReader reader = new LineReader(new FileReader(input));

    int counter = 0;
    String line;
    while ((line = reader.readLine()) != null) {
      server.add(this.parseObject(line));
      counter++;
    }
    server.commit();
    logger.info("Loaded {} JSON objects", counter);
View Full Code Here

Examples of com.google.common.io.LineReader

    InetSocketAddress socketAddress = discoverables.iterator().next().getSocketAddress();
    Socket socket = new Socket(socketAddress.getAddress(), socketAddress.getPort());
    try {
      PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), Charsets.UTF_8), true);
      LineReader reader = new LineReader(new InputStreamReader(socket.getInputStream(), Charsets.UTF_8));

      String msg = "Local file test";
      writer.println(msg);
      Assert.assertEquals(header, reader.readLine());
      Assert.assertEquals(msg, reader.readLine());
    } finally {
      socket.close();
    }

    controller.stopAndWait();
View Full Code Here

Examples of com.google.common.io.LineReader

      Socket socket = new Socket(discoverable.getSocketAddress().getAddress(),
                                 discoverable.getSocketAddress().getPort());
      try {
        PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), Charsets.UTF_8), true);
        LineReader reader = new LineReader(new InputStreamReader(socket.getInputStream(), Charsets.UTF_8));

        writer.println(msg);
        Assert.assertEquals(msg, reader.readLine());
      } finally {
        socket.close();
      }
    }
View Full Code Here

Examples of com.google.opengse.io.LineReader

   */
  boolean parse(Parser<RequestContext> parser, ByteArrayOutputStream baos,
      IOBuffer buf)
      throws IOException {
    if (parsing_http_) {
      LineReader reader = new IOBufferLineReader(buf, baos, READLINE_LIMIT);
      String line;
      while ((line = reader.readLine()) != null) {
        parser.parse(line, this);
        if (requestMethod == null) {
          // if no method was specified on the request line, check to
          // see if the line is entirely whitespace, in which case we
          // just ignore it.
View Full Code Here

Examples of com.intellij.util.text.LineReader

  private static String[] readStringsFromFile(String fileName) {
    String[] result = null;
    try {
      InputStream predefined = CfmlLangInfo.class.getResourceAsStream(fileName);
      if (predefined != null) {
        LineReader lineReader = new LineReader(predefined);

        //noinspection unchecked
        List<byte[]> list = lineReader.readLines();
        result = new String[list.size()];
        for (int i = 0; i < list.size(); i++) {
          byte[] bytes = list.get(i);
          final String s = new String(bytes);
          result[i] = s;
View Full Code Here

Examples of com.shop.util.LineReader

  {
    fSocket = s;
    fParentServer = parentServer;

    fIOInputStream = new GenericIOInputStream(new BufferedInputStream(fSocket.getInputStream(), fSocket.getReceiveBufferSize()), this);
    fIn = new LineReader(fIOInputStream);
    fOut = new GenericIOOutputStream(new BufferedOutputStream(fSocket.getOutputStream(), fSocket.getSendBufferSize()));
    fUserValue = new AtomicReference<T>(null);
    fLastReadTicks = new AtomicLong(System.currentTimeMillis());
    fLastFlushTicks = new AtomicLong(System.currentTimeMillis());
    fIsOpen = new AtomicBoolean(true);
View Full Code Here

Examples of edu.ucla.sspace.util.LineReader

    public FileDocument(String fileName, boolean cacheContents)
            throws IOException {
        this.fileName = fileName;
        if (cacheContents) {
            StringBuilder sb = new StringBuilder();
            for (String line : new LineReader(new File(fileName)))
                sb.append(line).append('\n');
            contents = sb.toString();
        }
        else
            contents = null;
View Full Code Here

Examples of edu.ucla.sspace.util.LineReader

 
  filesToProcess = new ArrayDeque<String>();
        documentsToReturn = new ArrayBlockingQueue<Document>(bufferSize);

  // read in all the files we have to process
        for (String line : new LineReader(new File(fileListName)))
      filesToProcess.offer(line.trim());     

        remaining = new AtomicInteger(filesToProcess.size());
        bufferError = null;
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.