Class SubtitleFilter

    • Field Detail

      • LOGGER

        protected final org.slf4j.Logger LOGGER
      • hasUtf8Bom

        protected boolean hasUtf8Bom
      • hasUtf8Encoding

        protected boolean hasUtf8Encoding
      • maxChar

        protected int maxChar
      • maxLine

        protected int maxLine
      • terminalPattern

        protected Pattern terminalPattern
    • Constructor Detail

      • SubtitleFilter

        public SubtitleFilter()
    • Method Detail

      • open

        public void open​(RawDocument input)
        Description copied from interface: IFilter
        Opens the input document described in a give RawDocument object. Skeleton information is always created when you use this method.
        Parameters:
        input - The RawDocument object to use to open the document.
      • open

        public void open​(RawDocument input,
                         boolean generateSkeleton)
        Description copied from interface: IFilter
        Opens the input document described in a give RawDocument object, and optionally creates skeleton information.
        Specified by:
        open in interface IFilter
        Overrides:
        open in class AbstractFilter
        Parameters:
        input - The RawDocument object to use to open the document.
        generateSkeleton - true to generate the skeleton data, false otherwise.
      • isUtf8Encoding

        protected boolean isUtf8Encoding()
        Is the input encoded as UTF-8?
        Overrides:
        isUtf8Encoding in class AbstractFilter
        Returns:
        true if the document is in utf8 encoding.
      • isUtf8Bom

        protected boolean isUtf8Bom()
        Does the input have a UTF-8 Byte Order Mark?
        Overrides:
        isUtf8Bom in class AbstractFilter
        Returns:
        true if the document has a utf-8 byte order mark.
      • isCJK

        public static boolean isCJK​(LocaleId localeId)
      • getMaxChar

        public int getMaxChar()
      • getMaxLine

        public int getMaxLine()
      • hasNext

        public boolean hasNext()
        Description copied from interface: IFilter
        Indicates if there is an event to process.

        Implementer Note: The caller must be able to call this method several times without changing state.

        Returns:
        True if there is at least one event to process, false if not.
      • endFilter

        protected void endFilter()
      • addString

        protected void addString​(String string)
      • isInsideTextRun

        protected boolean isInsideTextRun()
      • addToDocumentPart

        protected void addToDocumentPart​(String part)
      • addToTextUnit

        protected void addToTextUnit​(String text)
      • needToAppendWhitespace

        protected static boolean needToAppendWhitespace​(String str)
      • needToPrependWhitespace

        protected static boolean needToPrependWhitespace​(String str)
      • addCaptionAnnotation

        protected void addCaptionAnnotation​(String startTime,
                                            String endTime)
      • getTerminalRegex

        protected abstract String getTerminalRegex()
      • endsWithPunctuation

        protected boolean endsWithPunctuation​(String str)