On Mon, 2002-04-29 at 15:52, Adam McDaniel wrote:
> Set a threshold. If 25% (or so) turns to spacing, then hyphenate
> conservativly so everything looks reasonable.

I like that idea, but I think it might add unnecessary complexity to the
viewer if you try to do it "on the fly".  Especially since it would be
tricky at best to determine the "correct" place to put a hyphen.

What if that functionality were added to the parser instead of the
viewer?  When the parser reads an HTML file and an "auto-hyphenate"
option is set, the parser will insert a "soft" hyphen (­)
everywhere any word might legally be hyphenated.  Then, the viewer might
be modified so that when it encounters a soft hyphen, it will only
display it if the word is actually broken at that position.

The immediately visible drawback to this is:  increased file-size.  It
may increase the file by as much as 20 to 40 percent, depending on how
many words get hyphenated.  Still, it would be much more accurate (since
the parser could rely on word lists to direct the hyphenation, and even
have separate lists for different languages, like the "fop" processor
does).

I'm no Python guru, though, so I have no idea how hard this would be to
do in Python.  It's just a suggestion. :)

- Jamis

-- 
Jamis Buck
[EMAIL PROTECTED]
http://hippa-potta.jamisandtarasine.net
.
"I'd horsewhip you if I had a horse." -- Groucho Marx

Reply via email to