bugGNU troff - Bugs: bug #48904, Hyphenation patterns of type...

 
 

bug #48904: Hyphenation patterns of type '.a[135]' do not work

Submitted by:  Bjarni Ingi Gislason <bjarniig>
Submitted on:  Thu 25 Aug 2016 07:24:39 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Werner LEMBERG <wl>
Open/Closed: ClosedPlanned Release: 1.22.4

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 20 Sep 2016 05:09:37 AM UTC, comment #5:

Regarding wrong hyphenation patterns: Please contact its author(s)! groff simply takes what is available, without changes in the patterns. Note that it usually doesn't make any sense to comment on single patterns if they are derived with patgen (as is the case for `hyphen.sv') – there exists at least a single word in the original set of hyphenated words that uses it.

http://tug.org/tex-hyphen/

The patterns for US-English were also derived from a set of words, ignoring the first two and the last three characters of a word (you have to specify these two values while generating the patterns). This is a bit unfortunate since groff only can suppress two characters at the end, not three – it can thus happen that some words are incorrectly hyphenated because Liang's algorithm might produce artificial breakpoints while applying the patterns. In particular, you must set .hy to 12 or 14 for the US-English patterns, or you get much worse results.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sun 18 Sep 2016 11:57:56 PM UTC, comment #4:

Thanks for the fix. The hyphenation is now as expected.

There is a least one pattern that is wrong (outdated), '.i3so' in the
"hyphen.sv" file. The 'i' there is not a prefix.

By using ".hy 4" some hyphenation pattern are never tested.

Programs should not hide any kind of (input) errors. (Their authors and
maintainers are using "All errors (warnings) are equal but some are more
equal than others.)

Some comparisons in the "hyphen.us"

.hy hyphenation never
--- ----------- ----
1 hy\%phen\%a\%tion n\%ev\%er (error, from 'n5eve)
12|14 hyphen\%ation never

It looks like that some hyphenation points are derived from syllables
rather than genuine hyphenation, that takes pronunciation into account.

Bjarni Ingi Gislason <bjarniig>
Fri 09 Sep 2016 06:50:19 AM UTC, comment #3:

`.hy 8' is wrong for the Swedish patterns, it must be `.hy 4'; and the `.hy' flags were incorrectly handled by troff.

Both is now fixed in git, thanks for the report. Please test.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sun 28 Aug 2016 11:02:09 PM UTC, comment #2:

No, because

a) the file "sv.tmac" contains the '.hy 8' request

b) even if it did not, there is enough space to break the word 'ostra' at
'ost-ra' in the example. If the line length is shortened to 19n there is no
breakage.
To achieve that a '.hw o-st-ra' request is needed.

c) and evidently a one-letter prefix is never hyphenated (except in a 'hw' request), even with a valid pattern.

Case 'c' is caused by a hard-coded case. It is so in TEX (at least in the
original) and probably in the original "roff", as it is constructed for
English.

So the restriction 'no hyphenation of a one-letter prefix' should be
dropped (if a file with hyphenation patterns is used).

Add a number to the 'hy' request to prohibit a hyphenation of a one-letter
prefix.

The "Heirloom-troff" has added the values 16 and 32 to allow a
hyphenation of a one-letter suffix and prefix respectively, but that only
has an effect for explicit hyphenation marks according to the documentation
dated 17th September 2007. These numbers should work with hyphenation
patterns and actually prohibit, not allow, some specific hyphenation, just
as the traditional numbers greater than one do.

N.B.

The value 8 for '.hy' in 'sv.tmac' is wrong as there exist hyphenation
patterns of the form '.xy[135]' in Swedish.

There is also no explanation why a certain value is selected.

It is not the right of the author of a global tmac-file to include a
specific value (his own preference) for 'hy' except 0 with an explanation.
Only the user should change that for himself, if he wants reduced
hyphenations.

Bjarni Ingi Gislason <bjarniig>
Fri 26 Aug 2016 04:46:55 PM UTC, comment #1:

No time for a detailed analysis. However, if I say

using

as input, I get

which looks correct. Do you expect a different output?

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Thu 25 Aug 2016 07:24:39 PM UTC, original submission:

GROFF VERSION:
1.22.3

MACHINE:
GA-E350N Win8 from Gigabyte

OS:
Linux ... 3.16.36-1 #1 SMP Sun Jul 10 18:52:03 UTC 2016 x86_64 GNU/Linux

COMPILER:
That used by Debian groff (1.22.3-8)

INPUT FILES:
.fam C
.\" Width of each character is 6 points, 1m is 10 points
.ll 10n \" 50 points or 8.3 letters
.hla sv
.hpf hyphen.sv
.na
.hy 1
.\" hyphen.sv contains the pattern '.o3stra'
Sama ostra

COMMAND LINE:
groff -b -ww -Z <input file>

DESCRIPTION OF INCORRECT BEHAVIOUR:
Words are not hyphenated according to a pattern of type '.a[135]b'.

Output:

x T ps
x res 72000 1 1
x init
p1
x font 6 CR
f6
s10000
V12000
H72000
md
DFd
tSama
n12000 0
V24000
H72000
tostra
n12000 0
x trailer
V792000
x stop

Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by bjarniig (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 09 Sep 2016 06:50:19 AM UTCwlStatusNeed Info=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>1.22.4
    Fri 26 Aug 2016 04:46:55 PM UTCwlStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1