Class Hyphenator
java.lang.Object
org.apache.fop.hyphenation.Hyphenator
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HyphenationTreeReturns a hyphenation tree.static HyphenationTreegetHyphenationTree(String lang, String country, InternalResourceResolver resourceResolver, Map hyphPatNames, FOUserAgent foUserAgent) private static InputStreamgetHyphenationTreeStream(String name, InternalResourceResolver resourceResolver) private static InputStreamgetResourceStream(String key) static HyphenationTreegetUserHyphenationTree(String key, InternalResourceResolver resourceResolver) Load tree from serialized file or xml file using configuration settingsstatic Hyphenationhyphenate(String lang, String country, InternalResourceResolver resourceResolver, Map hyphPatNames, String word, int leftMin, int rightMin, FOUserAgent foUserAgent) private static HyphenationTree
-
Field Details
-
log
private static final org.apache.commons.logging.Log loglogging instance -
statisticsDump
private static boolean statisticsDumpEnables a dump of statistics. Note: If activated content is sent to System.out! -
HYPTYPE
-
XMLTYPE
-
-
Constructor Details
-
Hyphenator
private Hyphenator()
-
-
Method Details
-
getHyphenationTree
public static HyphenationTree getHyphenationTree(String lang, String country, InternalResourceResolver resourceResolver, Map hyphPatNames, FOUserAgent foUserAgent) -
getResourceStream
-
readHyphenationTree
-
getFopHyphenationTree
Returns a hyphenation tree. This method looks in the resources (getResourceStream) for the hyphenation patterns.- Parameters:
key- the language/country key- Returns:
- the hyphenation tree or null if it wasn't found in the resources
-
getUserHyphenationTree
public static HyphenationTree getUserHyphenationTree(String key, InternalResourceResolver resourceResolver) Load tree from serialized file or xml file using configuration settings- Parameters:
key- language key for the requested hyphenation fileresourceResolver- resource resolver to find the hyphenation files- Returns:
- the requested HypenationTree or null if it is not available
-
getHyphenationTreeStream
private static InputStream getHyphenationTreeStream(String name, InternalResourceResolver resourceResolver) throws IOException - Throws:
IOException
-
hyphenate
public static Hyphenation hyphenate(String lang, String country, InternalResourceResolver resourceResolver, Map hyphPatNames, String word, int leftMin, int rightMin, FOUserAgent foUserAgent)
-