Package net.sf.okapi.filters.table.base
Class BaseTableFilter
- java.lang.Object
-
- net.sf.okapi.common.filters.AbstractFilter
-
- net.sf.okapi.common.filters.AbstractLineFilter
-
- net.sf.okapi.filters.plaintext.base.BasePlainTextFilter
-
- net.sf.okapi.filters.table.base.BaseTableFilter
-
- All Implemented Interfaces:
AutoCloseable,Iterator<Event>,IFilter
- Direct Known Subclasses:
CommaSeparatedValuesFilter,FixedWidthColumnsFilter,TabSeparatedValuesFilter
public class BaseTableFilter extends BasePlainTextFilter
- Version:
- 0.1, 09.06.2009
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOLUMN_NUMBERprotected List<String>columnNamesprotected List<Integer>commentColumnsprotected List<Integer>commentSourceRefsstatic StringFILTER_CONFIGstatic StringFILTER_MIMEstatic StringFILTER_NAMEstatic StringMETADATA_COLUMN_PREFIXstatic StringROW_NUMBERprotected List<Integer>sourceColumnsprotected List<Integer>sourceIdColumnsprotected List<Integer>sourceIdSourceRefsprotected List<String>sourceIdSuffixesprotected List<Integer>targetColumnsprotected List<LocaleId>targetLanguagesprotected List<Integer>targetSourceRefs-
Fields inherited from class net.sf.okapi.filters.plaintext.base.BasePlainTextFilter
FILTER_CONFIG_TRIM_ALL, FILTER_CONFIG_TRIM_TRAIL
-
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 BaseTableFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TextProcessingResultextractCells(List<ITextUnit> cells, TextContainer lineContainer, long lineNum)Splits line into table cells.List<String>getColumnNames()protected StringgetFieldDelimiter()protected StringgetFieldQualifier()protected voidinit()protected booleanisMerging()protected booleanisSendListedMode()protected booleanprocessCells(List<ITextUnit> cells, long lineNum)protected TextProcessingResultprocessLine(TextContainer lineContainer)Called by the filter for every line read from the input-
Methods inherited from class net.sf.okapi.filters.plaintext.base.BasePlainTextFilter
callSubfilter, checkTU, isEmpty, processTU, sendAsSkeleton, sendAsSkeleton, sendAsSkeleton, sendAsSource, sendAsSource, sendAsSource, sendAsTarget
-
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, getMimeType, getName, getNewlineType, getParameters, getParameters, getParametersClassName, getParentId, getSrcLoc, getTrgLoc, isCanceled, isGenerateSkeleton, isMultilingual, isUtf8Bom, isUtf8Encoding, removeConfiguration, setDisplayName, setDocumentName, setEncoding, setFilterConfigurationMapper, 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
-
ROW_NUMBER
public static String ROW_NUMBER
-
COLUMN_NUMBER
public static String COLUMN_NUMBER
-
METADATA_COLUMN_PREFIX
public static final String METADATA_COLUMN_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
protected void init()
- Overrides:
initin classBasePlainTextFilter
-
processLine
protected TextProcessingResult processLine(TextContainer lineContainer)
Description copied from class:AbstractLineFilterCalled by the filter for every line read from the input- Overrides:
processLinein classBasePlainTextFilter- Returns:
-
extractCells
protected TextProcessingResult extractCells(List<ITextUnit> cells, TextContainer lineContainer, long lineNum)
Splits line into table cells.- Parameters:
line- string containing separated cells- Returns:
- string array of cells
-
getFieldDelimiter
protected String getFieldDelimiter()
-
getFieldQualifier
protected String getFieldQualifier()
-
isSendListedMode
protected boolean isSendListedMode()
-
isMerging
protected boolean isMerging()
-
-