|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectup.PennTreebankReader
public class PennTreebankReader
Read files in the Penn Treebank format.
Field Summary | |
---|---|
static java.lang.String |
ROOT_LABEL
The label used for the root node of a tree. |
Constructor Summary | |
---|---|
PennTreebankReader(TreeHandler handler)
Constructs a reader that sends the trees to the specified handler. |
Method Summary | |
---|---|
void |
read(java.io.File file)
Reads trees from the specified file. |
void |
read(java.io.File root,
int from,
int to)
Reads trees from the specified range of WSJ data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ROOT_LABEL
Constructor Detail |
---|
public PennTreebankReader(TreeHandler handler)
handler
- the tree handler to send the read trees toMethod Detail |
---|
public void read(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
file
- the file to read
java.io.FileNotFoundException
- if the specified file cannot be found
java.io.IOException
- if an error occurs during the reading of the
specified filepublic void read(java.io.File root, int from, int to) throws java.io.FileNotFoundException, java.io.IOException
root
- the root of the file structure containing the WSJ datafrom
- the lowest file number to be read from the specified file
structureto
- the highest file number to be read from the specified file
structure
java.io.FileNotFoundException
- if a file cannot be found
java.io.IOException
- if an error occurs during reading
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |