Client Side Hyphenation Library
Hyphenate Your Text!
You’d be surprised how much hyphenation can help improve the appearance of your fully justified text. This library implements automatic text hyphenation for English using javascript. Just drop a script reference into your page, and the script will automatically find all fully justified paragraph elements and hyphenate words to reduce whitespace "rivering". An article describing the motivation and implementation is forthcoming.
Update 3/30/2006: Since I’ve started getting comments and pingbacks on this, I realized that people might actually be using it. So I’ve made a VERY IMPORTANT UPDATE to the code. The update now removes unused hyphenation points, because those unused hyphenation points interfere with the browser’s "find" function. This is now fixed. Another update will be forthcoming which will account for paragraphs of fluid width, so stay tuned for that - but if you’re using a local copy of the script on your site, you should update it now.
Usage
I think it’s preferable to use the script from this site, by adding a script tag such as the following:
<script src="http://www.duckwizard.com/scripts/hyphen.js" type="text/javascript"></script>
This way, users will cache the script and won’t have to download it for every site that uses it. However, if you prefer to serve the script off of your own site, you’re welcome to do so. A warning: the script, including the pattern dictionary, is over 170 KB.



