Class BasePlainTextFilter
- java.lang.Object
-
- net.sf.okapi.common.filters.AbstractFilter
-
- net.sf.okapi.common.filters.AbstractLineFilter
-
- net.sf.okapi.filters.plaintext.base.BasePlainTextFilter
-
- All Implemented Interfaces:
AutoCloseable,Iterator<Event>,IFilter
- Direct Known Subclasses:
BaseTableFilter,ParaPlainTextFilter,SplicedLinesFilter
public class BasePlainTextFilter extends AbstractLineFilter
PlainTextFilterextracts lines of input text, separated by line terminators.- Version:
- 0.1, 09.06.2009
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILTER_CONFIGstatic StringFILTER_CONFIG_TRIM_ALLstatic StringFILTER_CONFIG_TRIM_TRAILstatic StringFILTER_MIMEstatic StringFILTER_NAME-
Fields inherited from class net.sf.okapi.common.filters.AbstractLineFilter
input, LINE_NUMBER, srcLang, startDoc, trgLang
-
Fields inherited from interface net.sf.okapi.common.filters.IFilter
SUB_FILTER
-
-
Constructor Summary
Constructors Constructor Description BasePlainTextFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<Event>callSubfilter(ITextUnit parent)protected booleancheckTU(ITextUnit textUnit)protected voidinit()protected booleanisEmpty(ITextUnit textUnit)protected TextProcessingResultprocessLine(TextContainer lineContainer)Called by the filter for every line read from the inputprotected booleanprocessTU(ITextUnit textUnit)protected TextProcessingResultsendAsSkeleton(String skelPart)protected TextProcessingResultsendAsSkeleton(ITextUnit textUnit)protected TextProcessingResultsendAsSkeleton(GenericSkeleton skelPart)protected TextProcessingResultsendAsSource(ITextUnit textUnit)protected TextProcessingResultsendAsSource(ITextUnit textUnit, boolean rejectEmpty)protected TextProcessingResultsendAsSource(TextContainer textContainer)protected TextProcessingResultsendAsTarget(ITextUnit target, ITextUnit source, LocaleId language)-
Methods inherited from class net.sf.okapi.common.filters.AbstractLineFilter
addLineBreak, cancel, close, done, getActiveSkeleton, getFirstDocumentPart, getFirstTextUnit, getHeadSkeleton, getLineBreak, getQueueSize, getTargetLocale, hasNext, next, open, open, sendEvent, sendEvent, waitForLine
-
Methods inherited from class net.sf.okapi.common.filters.AbstractFilter
addConfiguration, addConfiguration, addConfiguration, addConfigurations, createEndFilterEvent, createFilterWriter, createSkeletonWriter, createStartFilterEvent, findConfiguration, getConfiguration, getConfigurations, getDisplayName, getDocumentId, getDocumentName, getEncoderManager, getEncoding, getFilterConfigurationMapper, getFilterWriter, getMimeType, getName, getNewlineType, getParameters, getParameters, getParametersClassName, getParentId, getSrcLoc, getTrgLoc, isCanceled, isGenerateSkeleton, isMultilingual, isUtf8Bom, isUtf8Encoding, removeConfiguration, setDisplayName, setDocumentName, setEncoding, setFilterConfigurationMapper, setFilterWriter, setGenerateSkeleton, setMimeType, setMultilingual, setName, setNewlineType, setOptions, setParameters, setParentId, setSrcLoc, setTrgLoc
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Field Detail
-
FILTER_NAME
public static final String FILTER_NAME
- See Also:
- Constant Field Values
-
FILTER_MIME
public static final String FILTER_MIME
- See Also:
- Constant Field Values
-
FILTER_CONFIG
public static final String FILTER_CONFIG
- See Also:
- Constant Field Values
-
FILTER_CONFIG_TRIM_TRAIL
public static final String FILTER_CONFIG_TRIM_TRAIL
- See Also:
- Constant Field Values
-
FILTER_CONFIG_TRIM_ALL
public static final String FILTER_CONFIG_TRIM_ALL
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
protected void init()
- Overrides:
initin classAbstractLineFilter
-
sendAsSource
protected final TextProcessingResult sendAsSource(ITextUnit textUnit)
-
sendAsSource
protected final TextProcessingResult sendAsSource(ITextUnit textUnit, boolean rejectEmpty)
-
sendAsSource
protected final TextProcessingResult sendAsSource(TextContainer textContainer)
-
sendAsTarget
protected final TextProcessingResult sendAsTarget(ITextUnit target, ITextUnit source, LocaleId language)
-
sendAsSkeleton
protected final TextProcessingResult sendAsSkeleton(ITextUnit textUnit)
-
sendAsSkeleton
protected final TextProcessingResult sendAsSkeleton(GenericSkeleton skelPart)
-
sendAsSkeleton
protected final TextProcessingResult sendAsSkeleton(String skelPart)
-
processTU
protected boolean processTU(ITextUnit textUnit)
-
checkTU
protected boolean checkTU(ITextUnit textUnit)
-
isEmpty
protected boolean isEmpty(ITextUnit textUnit)
-
processLine
protected TextProcessingResult processLine(TextContainer lineContainer)
Description copied from class:AbstractLineFilterCalled by the filter for every line read from the input- Specified by:
processLinein classAbstractLineFilter- Returns:
-
-