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:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  Werner LEMBERG <wl>
Open/Closed:  Closed Planned 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.


( Jump to the original submission)

Thu 01 Mar 2018 07:31:30 PM UTC, comment #6: 

The original fix for this issue was flawed; it is now fixed with commit b5aaab51.  I've also implemented `.hy' values 16 and 32, as suggested.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
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.


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
  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

  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

  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.


  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

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

groff -msv -Tlatin1 sv.tr


.ll 20n
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra
Sama ostra

as input, I get

Sama ostra Sama ost-
ra Sama  ostra  Sama
ostra   Sama   ostra
Sama ostra Sama ost-
ra  Sama  ostra Sama
ostra   Sama   ostra
Sama ostra Sama ost-
ra Sama  ostra  Sama
ostra   Sama   ostra
Sama ostra

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:  


GA-E350N Win8 from Gigabyte

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

That used by Debian groff (1.22.3-8)

.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
.hy 1
.\" hyphen.sv contains the pattern '.o3stra'
Sama ostra

groff -b -ww -Z <input file>

  Words are not hyphenated according to a pattern of type '.a[135]b'.


x T ps
x res 72000 1 1
x init
x font 6 CR
n12000 0
n12000 0
x trailer
x stop

Bjarni Ingi Gislason <bjarniig>


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

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

    Only logged-in users can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-09-09 wl StatusNeed Info => Fixed
        Assigned toNone => wl
        Open/ClosedOpen => Closed
        Planned ReleaseNone => 1.22.4
    2016-08-26 wl StatusNone => Need Info

    Back to the top

    Powered by Savane 3.6