Automatic hyphenation can not be error free! Because ...
... homographs may be hyphenated differently.
desert (arid land) -> des‧ert
desert (to leave) -> de‧sert
In some patterns this is solved by not hyphenating ambiguous words at all.
... neologisms that are not in the list of words used for pattern creation may be hyphenated incorrectly.
blogosphere -> blog·o·sphere (Merriam webster)
// bl‧o‧gos‧phere (en-us patterns)
// blo‧go‧sphere (en-gb patterns)
... the rules for hyphenation may have changed or are not specified unambiguously.
dictionary -> dic‧tion‧ary (Wiktionary)
// dic·tio·nary (Merriam-Webster)
... the patterns differ in quality. Some are very new and reflect the current state of the language others are older. Some are based on a very large list of words others are crafted by hand (which is not necessarily bad).
In any case automatic hyphenation needs proofreading and may need some intervention.
Use a visible hyphen character to display all hyphen opportunities:
<script>
var Hyphenopoly = {
require: [...],
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
}
};
</script>
See also Setup#hyphen
There are three levels of fixing possibilities:
Words containing a soft hyphen (­) will not be hyphenated by Hyphenopoly.js. Therefor you can simply add soft hyphens manually to 'overwrite' automatic hyphenation.
pro:
contra:
Hyphenopoly.js has an API for hyphenation exceptions: https://github.com/mnater/Hyphenopoly/wiki/Setup#exceptions
<script>
var Hyphenopoly = {
require: {...},
setup: {
exceptions: {
"en-us": "desert, dic-tion-ary, dic-tion-aries, blog-o-sphere" //language-specific exceptions
},
selectors: {...}
}
};
</script>
In the example above Hyphenopoly.js will never hyphenate the word "desert" (exceptions are not case sensitive) and hyphenate the words "dictionary", "dictionaries" and "blogosphere" at the positions marked with a hyphen-minus.
pro:
contra:
Go to http://www.hyphenation.org/ and help to improve the patterns.
pro:
contra:
As an intermediate step to improved patterns, patterns also have the ability to include exceptions. Follow this guide (todo) to improve the patterns Hyphenopoly.js uses.