Class SimplePatternParser

    • Constructor Detail

      • SimplePatternParser

        public SimplePatternParser()
        Creates a new instance of PatternParser2
    • Method Detail

      • getPattern

        protected static String getPattern​(String word)
      • getInterletterValues

        protected static String getInterletterValues​(String pat)
      • main

        public static void main​(String[] args)
      • text

        public void text​(String str)
        Description copied from interface: SimpleXMLDocHandler
        Called when a text element is found.
        Specified by:
        text in interface SimpleXMLDocHandler
        Parameters:
        str - the text element, probably a fragment.
      • addClass

        public void addClass​(String c)
        Description copied from interface: PatternConsumer
        Add a character class. A character class defines characters that are considered equivalent for the purpose of hyphenation (e.g. "aA"). It usually means to ignore case.
        Specified by:
        addClass in interface PatternConsumer
        Parameters:
        c - character group
      • addException

        public void addException​(String w,
                                 ArrayList e)
        Description copied from interface: PatternConsumer
        Add a hyphenation exception. An exception replaces the result obtained by the algorithm for cases for which this fails or the user wants to provide his own hyphenation. A hyphenatedword is a vector of alternating String's and Hyphen instances
        Specified by:
        addException in interface PatternConsumer
        Parameters:
        w - The word to change
        e - A vector of alternating String's and Hyphen instances
      • addPattern

        public void addPattern​(String p,
                               String v)
        Description copied from interface: PatternConsumer
        Add hyphenation patterns.
        Specified by:
        addPattern in interface PatternConsumer
        Parameters:
        p - the pattern
        v - interletter values expressed as a string of digit characters.