public class CoNLLColumnFormatReader extends AnnotationReader<TextAnnotation>
form POS full-parse chunk NE verb-sense verb-lemma [verb1-args
[verb2-args ... ]]
Modifier and Type | Field and Description |
---|---|
protected int |
currentLine |
protected ArrayList<String> |
lines |
protected String |
predicateArgumentViewName |
protected String |
section |
corpusName, currentAnnotationId, resourceManager
Constructor and Description |
---|
CoNLLColumnFormatReader(String corpus,
String section,
String columnFile,
String predicateArgumentViewName,
TextAnnotationBuilder textAnnotationBuilder)
Initialize the reader.
|
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).
|
protected PredicateArgumentView |
getPredicateArgumentView(List<List<String>> argumentLabels,
List<List<Integer>> argumentStart,
List<List<Integer>> argumentEnd,
TextAnnotation ta,
List<String> verbSenses,
List<String> baseForms,
List<Integer> predicatePositions) |
boolean |
hasNext()
is there another annotation object to return?
|
protected void |
initializeReader()
called by constructor to perform subclass-specific initialization.
|
static void |
main(String[] args) |
protected SpanLabelView |
makeSpanLabeledView(List<String> chunkLabels,
List<Integer> chunkStart,
List<Integer> chunkEnd,
TextAnnotation ta,
String viewName) |
TextAnnotation |
next()
return the next annotation object.
|
void |
reset()
override this to conform to whatever the derived class's state mechanism requires.
|
protected boolean |
validate(List<String> chunkLabels,
List<Integer> chunkStart,
List<Integer> chunkEnd) |
iterator, remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
forEachRemaining
protected final String predicateArgumentViewName
protected final String section
protected int currentLine
public CoNLLColumnFormatReader(String corpus, String section, String columnFile, String predicateArgumentViewName, TextAnnotationBuilder textAnnotationBuilder) throws Exception
corpus
- The name of the corpussection
- The section of WSJ that is to be read. This is largely inconsequential, and is
used only to assign identifiers to the TextAnnotation
objects.columnFile
- The file containing the column format datapredicateArgumentViewName
- The name of the predicate argument view. For consistency,
use ViewNames#SRL_VERB
for verb SRL_VERB and ViewNames#SRL_NOM
for
SRL_NOM.Exception
public boolean hasNext()
AnnotationReader
hasNext
in interface Iterator<TextAnnotation>
hasNext
in class AnnotationReader<TextAnnotation>
public void reset()
AnnotationReader
reset
in interface IResetableIterator<TextAnnotation>
reset
in class AnnotationReader<TextAnnotation>
public TextAnnotation next()
next
in interface Iterator<TextAnnotation>
next
in class AnnotationReader<TextAnnotation>
protected PredicateArgumentView getPredicateArgumentView(List<List<String>> argumentLabels, List<List<Integer>> argumentStart, List<List<Integer>> argumentEnd, TextAnnotation ta, List<String> verbSenses, List<String> baseForms, List<Integer> predicatePositions)
protected SpanLabelView makeSpanLabeledView(List<String> chunkLabels, List<Integer> chunkStart, List<Integer> chunkEnd, TextAnnotation ta, String viewName)
protected boolean validate(List<String> chunkLabels, List<Integer> chunkStart, List<Integer> chunkEnd)
protected void initializeReader()
AnnotationReader
initializeReader
in class AnnotationReader<TextAnnotation>
public String generateReport()
generateReport
in class AnnotationReader<TextAnnotation>
Copyright © 2017. All rights reserved.