public class LineReader extends org.apache.uima.fit.component.JCasCollectionReader_ImplBase
LineReader is collection reader for cases when you want to read in files line-by-line such that there is one JCas per line.
This class has no relation to LineWriter - i.e. LineReader does not provide "reverse functionality" of LineWriter.
This class is very similar to PlainTextCollectionReader in that it allows you to specify a file or directory from which to read in plain text into a named view with a specified language and encoding. However, instead of reading in entire files as plain text, this collection reader reads in a file line-by-line where each line gets its own JCas.
LineReader uses an interface LineHandler which determines how lines from a file are used to initialize a JCas. The default implementation, DefaultLineHandler, simply expects each line to be plain text and the id of the document will be the number of lines read up to that point (across all files that are being read in.) A second implementation, SimpleLineHandler, assumes that an id for each line is provided in the text of the line and parses it out.
| Modifier and Type | Field and Description |
|---|---|
static String |
PARAM_COMMENT_SPECIFIERS |
static String |
PARAM_ENCODING |
static String |
PARAM_FILE_OR_DIRECTORY_NAME |
static String |
PARAM_LANGUAGE |
static String |
PARAM_LINE_HANDLER_CLASS_NAME |
static String |
PARAM_SKIP_BLANK_LINES |
static String |
PARAM_SUFFIXES |
static String |
PARAM_VIEW_NAME |
PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_MANAGER, PARAM_CONFIG_PARAM_SETTINGS, PARAM_EXTERNAL_OVERRIDE_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXT| Constructor and Description |
|---|
LineReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
getNext(JCas jCas) |
Progress[] |
getProgress() |
boolean |
hasNext() |
void |
initialize(UimaContext context) |
getLogger, getNext, initializedestroy, getCasInitializer, getProcessingResourceMetaData, initialize, isConsuming, reconfigure, setCasInitializer, typeSystemInitgetConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValuegetCasManager, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger, setMetaDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValuegetMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, setLoggerpublic static final String PARAM_COMMENT_SPECIFIERS
public static final String PARAM_ENCODING
public static final String PARAM_FILE_OR_DIRECTORY_NAME
public static final String PARAM_LANGUAGE
public static final String PARAM_LINE_HANDLER_CLASS_NAME
public static final String PARAM_SKIP_BLANK_LINES
public static final String PARAM_SUFFIXES
public static final String PARAM_VIEW_NAME
public LineReader()
public void close() throws IOException
close in interface BaseCollectionReaderclose in class org.apache.uima.fit.component.JCasCollectionReader_ImplBaseIOExceptionpublic void getNext(JCas jCas) throws IOException, CollectionException
getNext in class org.apache.uima.fit.component.JCasCollectionReader_ImplBaseIOExceptionCollectionExceptionpublic Progress[] getProgress()
public boolean hasNext() throws IOException, CollectionException
IOExceptionCollectionExceptionpublic void initialize(UimaContext context) throws ResourceInitializationException
initialize in class org.apache.uima.fit.component.JCasCollectionReader_ImplBaseResourceInitializationExceptionCopyright © 2014. All rights reserved.