edu.upenn.cis.pdtb.util
Class CorpusFileIterator

java.lang.Object
  extended byedu.upenn.cis.pdtb.util.CorpusFileIterator
All Implemented Interfaces:
java.io.FilenameFilter

public class CorpusFileIterator
extends java.lang.Object
implements java.io.FilenameFilter

Utility class for iterating over files in the corpus. For example:

   ....
   RelationLoader loader = new RelationLoaderImpl();
   for(CorpusFileIterator cfi = new CorpusFileIterator(textRoot, ptbRoot, pdtbRoot);
       cfi.hasMoreFiles();
       ){
      cfi.nextFile();
      String textFile = cfi.currentTextFile();
      String ptbFile = cfi.currentPtbFile();
      String pdtbFile = cfi.currentPdtbFile();
      loader.load(textFile, ptbFile, pdtbFile);
      ....
  }
 

Author:
nikhild
See Also:
RelationLoader

Constructor Summary
CorpusFileIterator(java.lang.String textRoot, java.lang.String ptbRoot, java.lang.String pdtbRoot)
          Creates a new instance of CorpusFileIterator
CorpusFileIterator(java.lang.String textRoot, java.lang.String ptbRoot, java.lang.String pdtbRoot, int minSec, int maxSec, int minFile, int maxFile)
           
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
           
 java.lang.String currentPdtbFile()
           
 java.lang.String currentPtbFile()
           
 java.lang.String currentTextFile()
           
 int getFileNo()
           
 java.lang.String getFileNoStr()
           
 int getSecNo()
           
 java.lang.String getSecNoStr()
           
 boolean hasMoreFiles()
           
 void nextFile()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CorpusFileIterator

public CorpusFileIterator(java.lang.String textRoot,
                          java.lang.String ptbRoot,
                          java.lang.String pdtbRoot)
Creates a new instance of CorpusFileIterator


CorpusFileIterator

public CorpusFileIterator(java.lang.String textRoot,
                          java.lang.String ptbRoot,
                          java.lang.String pdtbRoot,
                          int minSec,
                          int maxSec,
                          int minFile,
                          int maxFile)
Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Specified by:
accept in interface java.io.FilenameFilter

hasMoreFiles

public boolean hasMoreFiles()

nextFile

public void nextFile()

currentPdtbFile

public java.lang.String currentPdtbFile()

currentPtbFile

public java.lang.String currentPtbFile()

currentTextFile

public java.lang.String currentTextFile()

getSecNoStr

public java.lang.String getSecNoStr()

getSecNo

public int getSecNo()

getFileNoStr

public java.lang.String getFileNoStr()

getFileNo

public int getFileNo()