edu.upenn.cis.ptb.util
Class CorpusFileIterator

java.lang.Object
  extended byedu.upenn.cis.ptb.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 PTB. For example:

   ....
   PTBLoader loader = new PTBLoaderImpl();
   for(CorpusFileIterator cfi = new CorpusFileIterator(ptbRoot);
       cfi.hasMoreFiles();){
      cfi.nextFile();
      loader.load(cfi.currentFile());
      ....
  }
  

Since:
0.2.3
Author:
nikhild

Constructor Summary
CorpusFileIterator(java.lang.String ptbRoot)
          Creates a new instance of CorpusFileIterator
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
           
 java.lang.String currentFile()
           
 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 ptbRoot)
Creates a new instance of CorpusFileIterator

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()

getSecNoStr

public java.lang.String getSecNoStr()

getSecNo

public int getSecNo()

getFileNoStr

public java.lang.String getFileNoStr()

getFileNo

public int getFileNo()

currentFile

public java.lang.String currentFile()