Package com.teamten.hyphen
Class HyphenDictionary
java.lang.Object
com.teamten.hyphen.HyphenDictionary
A TeX-style hyphen dictionary.
-
Method Summary
Modifier and TypeMethodDescriptionstatic HyphenDictionary
fromResource
(String language) Reads a .dic file from a resource.Hyphenate the specified word, returning a list of word fragments between which hyphenation can happen.static String
segmentsToString
(List<String> segments) Takes a list of segments and return them separated by hyphens.
-
Method Details
-
fromResource
Reads a .dic file from a resource. Use e.g., "fr" for language.- Throws:
FileNotFoundException
- if the file can't be found.IOException
- if the file can't be loaded.
-
hyphenate
Hyphenate the specified word, returning a list of word fragments between which hyphenation can happen. Note that if the word already contains a hyphen, it will show up at the end of one of the fragments. Don't add another hyphen after that. -
segmentsToString
Takes a list of segments and return them separated by hyphens.
-