Class Hyphenator


  • public final class Hyphenator
    extends Object

    This class is the main entry point to the hyphenation package. You can use only the static methods or create an instance.

    This work was authored by Carlos Villegas (cav@uniscope.co.jp).

    • Field Detail

      • HYPTYPE

        public static final String HYPTYPE
      • XMLTYPE

        public static final String XMLTYPE
    • Method Detail

      • hyphenate

        public static Hyphenation hyphenate​(String lang,
                                            String country,
                                            String word,
                                            int leftMin,
                                            int rightMin)
        Hyphenates a word.
        Parameters:
        lang - the language
        country - the optional country code (may be null or "none")
        word - the word to hyphenate
        leftMin - the minimum number of characters before the hyphenation point
        rightMin - the minimum number of characters after the hyphenation point
        Returns:
        the hyphenation result
      • isNotCached

        public static boolean isNotCached​(String lang,
                                          String country)
      • getHyphenationTree

        public static HyphenationTree getHyphenationTree​(String lang,
                                                         String country)
        Returns a hyphenation tree for a given language and country, with fallback from (lang,country) to (lang). The hyphenation trees are cached.
        Parameters:
        lang - the language
        country - the country (may be null or "none")
        Returns:
        the hyphenation tree