java.lang.Objectcom.aspose.words.Hyphenation
public abstract class Hyphenation
Property Getters/Setters Summary | ||
---|---|---|
static IHyphenationCallback | getCallback() | |
static void | setCallback(IHyphenationCallback value) | |
Gets or sets callback interface used to request dictionaries when page layout of the document is built. This allows delay loading of dictionaries which may be usefull when processing documents in many languages. | ||
static IWarningCallback | getWarningCallback() | |
static void | setWarningCallback(IWarningCallback value) | |
Called during a load hyphenation patterns, when an issue is detected that might result in formatting fidelity loss. |
Method Summary | ||
---|---|---|
static boolean | isDictionaryRegistered(java.lang.String language) | |
Returns False if for the specified language there is no dictionary registered or if registered is Null dictionary, True otherwise. | ||
static void | registerDictionary(java.lang.String language, java.lang.String fileName) | |
Registers and loads a hyphenation dictionary for the specified language from file. Throws if dictionary cannot be read or has invalid format.
This method can also be used to register Null dictionary to prevent |
||
static void | unregisterDictionary(java.lang.String language) | |
Unregisters a hyphenation dictionary for the specified language. This is different from registering Null dictionary. Unregistering a dictionary enables callback for the specified language. |
Property Getters/Setters Detail |
---|
getCallback/setCallback | |
public static IHyphenationCallback getCallback() / public static void setCallback(IHyphenationCallback value) |
getWarningCallback/setWarningCallback | |
public static IWarningCallback getWarningCallback() / public static void setWarningCallback(IWarningCallback value) |
Method Detail |
---|
isDictionaryRegistered | |
public static boolean isDictionaryRegistered(java.lang.String language) |
Example:
Shows how to open check if some dictionary is registered.Document doc = new Document(getMyDir() + "Document.doc"); Hyphenation.registerDictionary("en-US", getMyDir() + "hyph_en_US.dic"); System.out.println(Hyphenation.isDictionaryRegistered("en-US")); // True
registerDictionary | |
public static void registerDictionary(java.lang.String language, java.lang.String fileName) throws java.lang.Exception |
language
- A language name, e.g. "en-US". See .NET documentation for "culture name" and RFC 4646 for details.fileName
- A path to the dictionary file in Open Office format.
If this parameter is null or empty string then registered is Null dictionary and callback is not called anymore for this language.
To enable callback again use Example:
Shows how to open and register a dictionary from a file.Document doc = new Document(getMyDir() + "Document.doc"); // Register by String Hyphenation.registerDictionary("en-US", getMyDir() + "hyph_en_US.dic"); // Register by stream InputStream dictionaryStream = new FileInputStream(getMyDir() + "hyph_de_CH.dic"); Hyphenation.registerDictionary("de-CH", dictionaryStream);
unregisterDictionary | |
public static void unregisterDictionary(java.lang.String language) |
language
- A language name, e.g. "en-US". See .NET documentation for "culture name" and RFC 4646 for details.
If null or empty string then all dictionaries are unregistered.Example:
Shows how to un-register a dictionaryDocument doc = new Document(getMyDir() + "Document.doc"); Hyphenation.registerDictionary("en-US", getMyDir() + "hyph_en_US.dic"); Hyphenation.unregisterDictionary("en-US"); System.out.println(Hyphenation.isDictionaryRegistered("en-US")); // False