Page 2 of 2
Re: Hyphenation of long words
Posted: Mon Feb 19, 2018 9:54 pm
by richmond62
it's very close to a good hyphen
Well, as we know, all good programmers go to "Hyphen"
while bad programmers have to make a dash for it

Re: Hyphenation of long words
Posted: Mon Feb 19, 2018 9:59 pm
by dunbarx
Max.
Am i misunderstanding how to use your function? I get massively truncated lines with any sort of text, and hyphens in all the wrong places.
Craig
Re: Hyphenation of long words
Posted: Mon Feb 19, 2018 10:01 pm
by dunbarx
Richmond.
Craig
Re: Hyphenation of long words
Posted: Mon Feb 19, 2018 10:04 pm
by bogs
Don't sweat it Richmond, I appreciated it

Re: Hyphenation of long words
Posted: Tue Feb 20, 2018 12:19 pm
by MaxV
dunbarx wrote: Mon Feb 19, 2018 9:59 pm
Max.
Am i misunderstanding how to use your function? I get massively truncated lines with any sort of text, and hyphens in all the wrong places.
Craig
If you want max 80 chars per line into a field:
Code: Select all
put field "myLongText" into temp
put hypnen( temp, 80) into field "myLongText"
In Italian works quite good, I have just to fix with punctuation marks:
Re: Hyphenation of long words
Posted: Tue Feb 20, 2018 4:15 pm
by dunbarx
Ah, I see what happened. i misunderstood what "tSize" meant. It means the length of a line.
Craig
Re: Hyphenation of long words
Posted: Tue Feb 20, 2018 8:39 pm
by [-hh]
Hyphenation is a non-trivial optimization problem. Knuth did a lot in that field for TeX.
https://en.wikipedia.org/wiki/Hyphenation_algorithm
Here a linguistic approach based on that and hunspell (link from the page above).
http://www.ushuaia.pl/hyphen/?ln=en
Re: Hyphenation of long words
Posted: Sat Feb 24, 2018 1:08 pm
by theotherbassist
Hypnen! Sounds like great ambient prog-disco.
I like the simplicity of it. Maybe a few more rules could even tighten things up a bit more on average... does anyone know the actual Knuth–Liang hyphenation algorithm? I can't seem to find the nuts and bolts of it--only a bunch of talk about it.
Re: Hyphenation of long words
Posted: Sat Feb 24, 2018 7:12 pm
by [-hh]
theotherbassist wrote:... does anyone know the actual Knuth–Liang hyphenation algorithm?
Here's Liang's thesis as PDF
http://www.tug.org/docs/liang/
Beneath my link above (hunspell) there is also a brilliant JavaScript implementation based on that:
https://github.com/mnater/Hyphenator
I implemented it already (via a browser widget for english, french, german, italian and spanish). Works fine.
Re: Hyphenation of long words
Posted: Sat Feb 24, 2018 10:18 pm
by theotherbassist
Thanks!
