Package edu.stanford.nlp.io

Examples of edu.stanford.nlp.io.FileSequentialCollection


    //
    // Process one file or a directory of files
    //
    if(properties.containsKey("file")){
      String fileName = properties.getProperty("file");
      Collection<File> files = new FileSequentialCollection(new File(fileName), properties.getProperty("extension"), true);
      this.processFiles(null, files, numThreads);
    }

    //
    // Process a list of files
    //
    else if (properties.containsKey("filelist")){
      String fileName = properties.getProperty("filelist");
      Collection<File> inputfiles = readFileList(fileName);
      Collection<File> files = new ArrayList<File>(inputfiles.size());
      for (File file:inputfiles) {
        if (file.isDirectory()) {
          files.addAll(new FileSequentialCollection(new File(fileName), properties.getProperty("extension"), true));
        } else {
          files.add(file);
        }
      }
      this.processFiles(null, files, numThreads);
    }
View Full Code Here


      Tree nextTree = null;
      int fpsize = filePaths.size();
      while (nextTree == null && fileUpto <= fpsize) {
        if (tr == null && (fileIterator == null || ! fileIterator.hasNext())) {
          if (fileUpto < fpsize) {
            FileSequentialCollection fsc = new FileSequentialCollection(Collections.singletonList(filePaths.get(fileUpto)), fileFilters.get(fileUpto));
            fileIterator = fsc.iterator();
          }
          // else we're finished, but increment anyway so we leave outermost loop
          fileUpto++;
        }
        while (nextTree == null && (tr != null || (fileIterator != null && fileIterator.hasNext()))) {
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.io.FileSequentialCollection

Copyright © 2018 www.massapicom. 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.