public class PennTreebankReader extends AnnotationReader<TextAnnotation>
Modifier and Type | Field and Description |
---|---|
protected String |
combinedWSJHome |
protected int |
currentSectionId |
static String |
PENN_TREEBANK_WSJ |
protected String[] |
sections |
corpusName, currentAnnotationId, resourceManager
Constructor and Description |
---|
PennTreebankReader(String treebankHome)
Reads all the sections of the combined annotation from penn treebank
|
PennTreebankReader(String treebankHome,
String parseViewName)
Reads all the sections of the combined annotation from penn treebank
|
PennTreebankReader(String treebankHome,
String[] sections)
Reads the specified sections from penn treebank
|
PennTreebankReader(String treebankHome,
String[] sections,
String parseViewName,
String sourceFileExtension,
String annotationFileExtension)
Reads the specified sections from penn treebank
|
Modifier and Type | Method and Description |
---|---|
String |
generateReport()
TODO: generate a human-readable report of annotations read from the source file (plus whatever
other relevant statistics the user should know about).
|
boolean |
hasNext()
is there another annotation object to return?
|
protected void |
initializeReader()
called by constructor to perform subclass-specific initialization.
|
TextAnnotation |
next()
return the next annotation object.
|
void |
remove() |
iterator, reset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
forEachRemaining
public static final String PENN_TREEBANK_WSJ
protected final String[] sections
protected final String combinedWSJHome
protected int currentSectionId
public PennTreebankReader(String treebankHome) throws Exception
treebankHome
- The directory that points to the merged (mrg) files of the WSJ portionException
public PennTreebankReader(String treebankHome, String parseViewName) throws Exception
treebankHome
- The directory that points to the merged (mrg) files of the WSJ portionparseViewName
- The name of the parse view which is to be addedException
public PennTreebankReader(String treebankHome, String[] sections) throws Exception
treebankHome
- The directory that points to the merged (mrg) files of the WSJ portionException
public PennTreebankReader(String treebankHome, String[] sections, String parseViewName, String sourceFileExtension, String annotationFileExtension) throws Exception
treebankHome
- The directory that points to the merged (mrg) files of the WSJ portionException
protected void initializeReader()
AnnotationReader
initializeReader
in class AnnotationReader<TextAnnotation>
public boolean hasNext()
AnnotationReader
hasNext
in interface Iterator<TextAnnotation>
hasNext
in class AnnotationReader<TextAnnotation>
public TextAnnotation next()
next
in interface Iterator<TextAnnotation>
next
in class AnnotationReader<TextAnnotation>
public void remove()
remove
in interface Iterator<TextAnnotation>
remove
in class AnnotationReader<TextAnnotation>
public String generateReport()
generateReport
in class AnnotationReader<TextAnnotation>
Copyright © 2017. All rights reserved.