Package net.sf.okapi.filters.vtt
Class VTTFilter
- java.lang.Object
-
- net.sf.okapi.common.filters.AbstractFilter
-
- net.sf.okapi.filters.subtitles.SubtitleFilter
-
- net.sf.okapi.filters.vtt.VTTFilter
-
- All Implemented Interfaces:
AutoCloseable,Iterator<Event>,IFilter
public class VTTFilter extends SubtitleFilter
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILTER_MIMEstatic StringFILTER_NAMEstatic PatternHEADER_PATTERNstatic StringHEADER_REGEX-
Fields inherited from class net.sf.okapi.filters.subtitles.SubtitleFilter
DEFAULT_TIME_FORMAT, eventBuilder, formatter, hasUtf8Bom, hasUtf8Encoding, maxChar, maxLine, params, terminalPattern
-
Fields inherited from interface net.sf.okapi.common.filters.IFilter
SUB_FILTER
-
-
Constructor Summary
Constructors Constructor Description VTTFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the input document.ISkeletonWritercreateSkeletonWriter()Default case.VTTParametersgetParameters()Gets the current parameters for this filter.protected StringgetTerminalRegex()Eventnext()Gets the next event available.voidopen(RawDocument input, boolean generateSkeleton)Opens the input document described in a give RawDocument object, and optionally creates skeleton information.voidsetParameters(IParameters params)Sets new parameters for this filter.-
Methods inherited from class net.sf.okapi.filters.subtitles.SubtitleFilter
addCaptionAnnotation, addString, addToDocumentPart, addToTextUnit, endFilter, endsWithPunctuation, getDateTimeFormatter, getMaxChar, getMaxLine, hasNext, isCJK, isInsideTextRun, isUtf8Bom, isUtf8Encoding, makeCaptionAnnotation, needToAppendWhitespace, needToPrependWhitespace, open
-
Methods inherited from class net.sf.okapi.common.filters.AbstractFilter
addConfiguration, addConfiguration, addConfiguration, addConfigurations, cancel, createEndFilterEvent, createFilterWriter, createStartFilterEvent, findConfiguration, getConfiguration, getConfigurations, getDisplayName, getDocumentId, getDocumentName, getEncoderManager, getEncoding, getFilterConfigurationMapper, getMimeType, getName, getNewlineType, getParameters, getParametersClassName, getParentId, getSrcLoc, getTrgLoc, isCanceled, isGenerateSkeleton, isMultilingual, removeConfiguration, setDisplayName, setDocumentName, setEncoding, setFilterConfigurationMapper, setGenerateSkeleton, setMimeType, setMultilingual, setName, setNewlineType, setOptions, 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
-
HEADER_REGEX
public static final String HEADER_REGEX
- See Also:
- Constant Field Values
-
HEADER_PATTERN
public static final Pattern HEADER_PATTERN
-
-
Method Detail
-
setParameters
public void setParameters(IParameters params)
Description copied from interface:IFilterSets new parameters for this filter.- Specified by:
setParametersin interfaceIFilter- Overrides:
setParametersin classSubtitleFilter- Parameters:
params- The new parameters to use.
-
getParameters
public VTTParameters getParameters()
Description copied from interface:IFilterGets the current parameters for this filter.- Specified by:
getParametersin interfaceIFilter- Overrides:
getParametersin classSubtitleFilter- Returns:
- The current parameters for this filter, or
DefaultParametersif this filter has no parameters.
-
createSkeletonWriter
public ISkeletonWriter createSkeletonWriter()
Description copied from class:AbstractFilterDefault case. Override if needed.- Specified by:
createSkeletonWriterin interfaceIFilter- Overrides:
createSkeletonWriterin classAbstractFilter- Returns:
- new instance of
GenericSkeletonWriter
-
close
public void close()
Description copied from interface:IFilterCloses the input document. Developers should call this method from within their code before sending the last event: This can allow writer objects to overwrite the input file when they receive the last event. This method must also be safe to call even if the input document is not opened.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceIFilter- Overrides:
closein classAbstractFilter
-
open
public void open(RawDocument input, boolean generateSkeleton)
Description copied from interface:IFilterOpens the input document described in a give RawDocument object, and optionally creates skeleton information.- Specified by:
openin interfaceIFilter- Overrides:
openin classSubtitleFilter- Parameters:
input- The RawDocument object to use to open the document.generateSkeleton- true to generate the skeleton data, false otherwise.
-
next
public Event next()
Description copied from interface:IFilterGets the next event available. Calling this method can be done only once on each event.- Returns:
- The next event available or null if there are no events.
-
getTerminalRegex
protected String getTerminalRegex()
- Specified by:
getTerminalRegexin classSubtitleFilter
-
-