public abstract static class AbstractHyphenator.util.DefaultFullHyphenator extends AbstractHyphenator.util.LanguageBasedDispatchingFullHyphenator
Modifier | Constructor and Description |
---|---|
protected |
DefaultFullHyphenator() |
protected |
DefaultFullHyphenator(boolean keepStyle) |
Modifier and Type | Method and Description |
---|---|
protected abstract byte[] |
getHyphenationOpportunities(String textWithoutHyphens,
Locale language)
Get hyphenation opportunities as a byte array (1 = SHY, 2 = ZWSP)
|
protected abstract boolean |
isCodePointAware()
Whether the length of the array returned by
getHyphenationOpportunities(String, Locale) is based on the number of code points
in the input or the number of characters. |
protected abstract boolean |
isLanguageAdaptive()
Whether
getHyphenationOpportunities(String, Locale) takes into account the
language argument. |
protected byte[] |
transform(byte[] manualHyphens,
String textWithoutHyphens,
Locale language) |
Iterable<CSSStyledText> |
transform(Iterable<CSSStyledText> text) |
protected Iterable<CSSStyledText> |
transform(Iterable<CSSStyledText> text,
Locale language) |
String |
transform(String text,
org.daisy.braille.css.SimpleInlineStyle style,
Locale language)
Optimized version of
transform(Iterable) for cases where the input has a
single segment. |
protected DefaultFullHyphenator()
protected DefaultFullHyphenator(boolean keepStyle)
keepStyle
- Whether to preserve hyphens
properties in the output of
transform(Iterable)
. This is useful when the output of a
hyphenator needs to be fed into a second hyphenator.protected abstract boolean isCodePointAware()
getHyphenationOpportunities(String, Locale)
is based on the number of code points
in the input or the number of characters.protected abstract boolean isLanguageAdaptive()
getHyphenationOpportunities(String, Locale)
takes into account the
language
argument.protected abstract byte[] getHyphenationOpportunities(String textWithoutHyphens, Locale language) throws Hyphenator.NonStandardHyphenationException
textWithoutHyphens
- text that does not contain SHY and ZWSP characters (and from
which no SHY and ZWSP characters were extracted either)Hyphenator.NonStandardHyphenationException
public Iterable<CSSStyledText> transform(Iterable<CSSStyledText> text) throws Hyphenator.NonStandardHyphenationException
transform
in interface Hyphenator.FullHyphenator
transform
in class AbstractHyphenator.util.LanguageBasedDispatchingFullHyphenator
Hyphenator.NonStandardHyphenationException
public String transform(String text, org.daisy.braille.css.SimpleInlineStyle style, Locale language) throws Hyphenator.NonStandardHyphenationException
transform(Iterable)
for cases where the input has a
single segment.protected Iterable<CSSStyledText> transform(Iterable<CSSStyledText> text, Locale language) throws Hyphenator.NonStandardHyphenationException
transform
in class AbstractHyphenator.util.LanguageBasedDispatchingFullHyphenator
Hyphenator.NonStandardHyphenationException
protected final byte[] transform(byte[] manualHyphens, String textWithoutHyphens, Locale language) throws Hyphenator.NonStandardHyphenationException
manualHyphens
- SHY, ZWSP and US characters that were extracted from the original
text, which resulted in textWithoutHyphens
textWithoutHyphens
- text without SHY, ZWSP and US charactersHyphenator.NonStandardHyphenationException
Copyright © 2010–2024 The DAISY Consortium. All rights reserved.