Package org.apache.fop.hyphenation
Class Hyphenator
- java.lang.Object
-
- org.apache.fop.hyphenation.Hyphenator
-
public final class Hyphenator extends java.lang.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 Summary
Fields Modifier and Type Field Description static java.lang.String
HYPTYPE
private static org.apache.commons.logging.Log
log
logging instanceprivate static boolean
statisticsDump
Enables a dump of statistics.static java.lang.String
XMLTYPE
-
Constructor Summary
Constructors Modifier Constructor Description private
Hyphenator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HyphenationTree
getFopHyphenationTree(java.lang.String key)
Returns a hyphenation tree.static HyphenationTree
getHyphenationTree(java.lang.String lang, java.lang.String country, InternalResourceResolver resourceResolver, java.util.Map hyphPatNames, FOUserAgent foUserAgent)
private static java.io.InputStream
getHyphenationTreeStream(java.lang.String name, InternalResourceResolver resourceResolver)
private static java.io.InputStream
getResourceStream(java.lang.String key)
static HyphenationTree
getUserHyphenationTree(java.lang.String key, InternalResourceResolver resourceResolver)
Load tree from serialized file or xml file using configuration settingsstatic Hyphenation
hyphenate(java.lang.String lang, java.lang.String country, InternalResourceResolver resourceResolver, java.util.Map hyphPatNames, java.lang.String word, int leftMin, int rightMin, FOUserAgent foUserAgent)
private static HyphenationTree
readHyphenationTree(java.io.InputStream in)
-
-
-
Field Detail
-
log
private static final org.apache.commons.logging.Log log
logging instance
-
statisticsDump
private static boolean statisticsDump
Enables a dump of statistics. Note: If activated content is sent to System.out!
-
HYPTYPE
public static final java.lang.String HYPTYPE
-
XMLTYPE
public static final java.lang.String XMLTYPE
-
-
Method Detail
-
getHyphenationTree
public static HyphenationTree getHyphenationTree(java.lang.String lang, java.lang.String country, InternalResourceResolver resourceResolver, java.util.Map hyphPatNames, FOUserAgent foUserAgent)
-
getResourceStream
private static java.io.InputStream getResourceStream(java.lang.String key)
-
readHyphenationTree
private static HyphenationTree readHyphenationTree(java.io.InputStream in)
-
getFopHyphenationTree
public static HyphenationTree getFopHyphenationTree(java.lang.String key)
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(java.lang.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 java.io.InputStream getHyphenationTreeStream(java.lang.String name, InternalResourceResolver resourceResolver) throws java.io.IOException
- Throws:
java.io.IOException
-
hyphenate
public static Hyphenation hyphenate(java.lang.String lang, java.lang.String country, InternalResourceResolver resourceResolver, java.util.Map hyphPatNames, java.lang.String word, int leftMin, int rightMin, FOUserAgent foUserAgent)
-
-