edu.upenn.cis.ptb.util
Class CorpusFileIterator
java.lang.Object
edu.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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CorpusFileIterator
public CorpusFileIterator(java.lang.String ptbRoot)
- Creates a new instance of CorpusFileIterator
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()