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).
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HYPTYPE |
static java.lang.String |
XMLTYPE |
Modifier and Type | Method and Description |
---|---|
static void |
clearHyphenationTreeCache()
Clears the default hyphenation tree cache.
This method can be used if the underlying data files are changed at runtime. |
static HyphenationTree |
getFopHyphenationTree(java.lang.String key)
Returns a hyphenation tree.
|
static HyphenationTree |
getHyphenationTree(java.lang.String lang,
java.lang.String country,
InternalResourceResolver resolver,
java.util.Map hyphPatNames)
Returns a hyphenation tree for a given language and country,
with fallback from (lang,country) to (lang).
|
static HyphenationTree |
getHyphenationTree(java.lang.String lang,
java.lang.String country,
InternalResourceResolver resourceResolver,
java.util.Map hyphPatNames,
EventBroadcaster eventBroadcaster) |
static HyphenationTreeCache |
getHyphenationTreeCache() |
static HyphenationTree |
getUserHyphenationTree(java.lang.String key,
InternalResourceResolver resourceResolver)
Load tree from serialized file or xml file
using configuration settings
|
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)
Hyphenates a word.
|
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,
EventBroadcaster eventBroadcaster) |
public static final java.lang.String HYPTYPE
public static final java.lang.String XMLTYPE
public static HyphenationTreeCache getHyphenationTreeCache()
public static void clearHyphenationTreeCache()
public static HyphenationTree getHyphenationTree(java.lang.String lang, java.lang.String country, InternalResourceResolver resolver, java.util.Map hyphPatNames)
lang
- the languagecountry
- the country (may be null or "none")resolver
- resolver to find the hyphenation fileshyphPatNames
- the map with user-configured hyphenation pattern file namespublic static HyphenationTree getHyphenationTree(java.lang.String lang, java.lang.String country, InternalResourceResolver resourceResolver, java.util.Map hyphPatNames, EventBroadcaster eventBroadcaster)
public static HyphenationTree getFopHyphenationTree(java.lang.String key)
key
- the language/country keypublic static HyphenationTree getUserHyphenationTree(java.lang.String key, InternalResourceResolver resourceResolver)
key
- language key for the requested hyphenation fileresourceResolver
- resource resolver to find the hyphenation filespublic 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)
lang
- the languagecountry
- the optional country code (may be null or "none")resourceResolver
- resolver to find the hyphenation fileshyphPatNames
- the map with user-configured hyphenation pattern file namesword
- the word to hyphenateleftMin
- the minimum number of characters before the hyphenation pointrightMin
- the minimum number of characters after the hyphenation pointpublic 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, EventBroadcaster eventBroadcaster)
Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.