bugGNU roff - Bugs: bug #52457, [tmac] wrong hyphenation mode used...

 
 

bug #52457: [tmac] wrong hyphenation mode used for English

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Sun 19 Nov 2017 10:01:29 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 10 Jul 2021 03:28:25 PM UTC, comment #10: 

This was fixed earlier this year.

Also see the first item (as of this writing) in <https://git.savannah.gnu.org/cgit/groff.git/plain/NEWS>.


commit a60784b82a5c53caff5443fc036b8d13f4084a32
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri Jan 15 03:27:15 2021 +1100

    tmac/en.tmac: Set hyphenation mode to 4.

diff --git a/tmac/en.tmac b/tmac/en.tmac
index 6aae40db..0bc41967 100644
--- a/tmac/en.tmac
+++ b/tmac/en.tmac
@@ -22,6 +22,9 @@
 .
 .ds locale english\"
 .
+.\" Set the minimum hyphenation mode that works with the patterns.
+.hy 4
+.
 .\" Set the hyphenation language to English.
 .do hla en
 .


G. Branden Robinson <gbranden>
Group administrator
Sun 26 Nov 2017 04:06:20 PM UTC, comment #9: 

  To comment #7:

  I only make simple patches that do (might) correct mistakes.

  Feedback (criticism) is vital, otherwise (better) corrections could
not be applied.


Bjarni Ingi Gislason <bjarniig>
Sun 26 Nov 2017 03:49:46 PM UTC, comment #8: 

Comments to comment #5 (Werner Lemberg)

  First paragraph:

This makes me think more, which is an advancement.

They are to think about.

It is not that, what you say it is.

People usually (tend to) do that to others, that was done to them.

  Second paragraph:

  This makes me to be the next on the list as I am the discoverer.
I will then make a new report and provide a patch if I find a simple
cure for the mistakes.
Otherwise other people have to take over.

Bjarni Ingi Gislason <bjarniig>
Fri 24 Nov 2017 02:21:27 PM UTC, comment #7: 

Regarding Werner's comment #6:

Whatever you do, please refrain from adding yet another display macro to the groff_man(7) language.  It is very clear that .NH/.HY is not different enough from .EX/.EE to warrant even more user interface proliferation.  While man(7) has many fundamental gaps in functionality, it already provides an excessive number of possibilities to enclose displays: .nf/.fi, .in, .RS/.RE, .EX/.EE, .DS/.DE, .SY/.YS, ...

It would be better to delete .DS/.DE than to add yet more on top of this pile.

Manual page writers should not need to worry about hyphenation mode.  It's a tiny technicality that is merely a distraction from the process of writing manuals.  Clean manual pages should never contain explicit hyphenation instructions (yes, i know the groff manuals themselves are prone to playing with all unimportant knobs that could be found over the decades).

Ingo Schwarze <schwarze>
Group Member
Fri 24 Nov 2017 05:24:01 AM UTC, comment #6: 

With all due respect, Bjarni, your philosophical roamings don't belong into a bug report.

I fear Bernd won't no longer be able to do any work due to his mental illness, and I simply don't have time to work on such issues, sorry.

The corollary of this discussion is that ill-formed `.nh/.hy' pairs must be replaced with `.nh/.hy \[.hy]'.  Or perhaps even better, groff's man macros should be extended with a `.NH/.HY' pair (in file `an-ext.tmac') in case you think that `.EX/.EE' isn't sufficient.

Werner LEMBERG <wl>
Group administrator
Thu 23 Nov 2017 11:55:48 PM UTC, comment #5: 

  More examples of wrong ".nh/.hy" pairing

  1) contrib/glilypond/glilypond.1.man

  The blame goes to Bernd Warken, who is thus the default patch maker.

  2) contrib/groffer/groffer.1.man

  The blame goes to Werner Lemberg, who is thus the appropriate
corrector of the errors.

  Those who make an error should usually be the ones who ought to correct
them.

#####

There is a saying,

Any fool can learn from his own experience;
The wise man learns from the experience of others.

Now I do not believe that the first line is correct, but
very definitely the second.

Herman Rubin on the Usenet forum "misc.education"
#
There is a saying:

Any fool can learn from his own experience.
The wise man learns from the experience of others.

Now I am not convinced of the first, but the second is
certainly the case.  This is education.

Herman Rubin on the Usenet forum "misc.education"
#
Any fool can learn from his own experience;
The wise man learns from the experience of others.

I do not believe that the first line of this adage is correct;
too many seem unable to do so.  But the second line is usually
right on.  It took mankind thousands of years to learn concepts
which we can teach to small children, such as the ideas of
writing and alphabetic writing.  The same holds for mathematical
concepts and the important mathematical notation.

Herman Rubin on the Usenet forum "misc.education"
#
There is a saying,

Any fool can learn from his own experience,
The wise man learns from the experience of others.

Too many students show that the first line is not correct.
But the second is very important, and is the basis of
the setting up of an educational program.

Herman Rubin á tölvutorginu "misc.education"
#
However, for education we have (I do not believe the
author is known):

Any fool can learn from his own experience.
The wise man learns from the experience of others.

Personally, I believe the first line is false, but the
second is what is needed for a good education.

In the sciences, authority counts for little.  Quoting
Newton will not avail, unless he was correct in that
instance.  He was not always correct.

Herman Rubin on the Usenet forum "misc.education"


Bjarni Ingi Gislason <bjarniig>
Thu 23 Nov 2017 01:04:34 PM UTC, comment #4: 

  Wrong evidence (another bug).

  My example is

test-groff -Tpdf -mandoc contrib/hdtbl/examples/groff_hdtbl.7 \
 > groff_htbl.7.pdf

  The error is caused by using a '.nh" request after a no-fill request
and ".hy" after the ".fi" request.

  Another bug report is on the way.

  The patch for "troffrc" is still valid.

Bjarni Ingi Gislason <bjarniig>
Wed 22 Nov 2017 11:55:31 PM UTC, comment #3: 

  Yes, I forgot again to provide evidence.
The malformed hyphenations are in the file
"contrib/mom/examples/typesetting.ps".

  The bug is thus in the file "tmac/troffrc".


From b78a6bd47857935f09672f78d25362aa2c1d70b4 Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Wed, 22 Nov 2017 23:38:03 +0000
Subject: [PATCH] Use the correct value for the .hy request for each language

  The default value for the .hy request is 1.

  When a hyphenation language is selected, the same hyphenation restrictions
must be chosen that were used, when the hyphenation patterns were created.

  Additionally the number '2' (no last-line hyphenation on a page).

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 tmac/troffrc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tmac/troffrc b/tmac/troffrc
index 6dca1dbd..8f8e1832 100644
--- a/tmac/troffrc
+++ b/tmac/troffrc
@@ -40,6 +40,12 @@ troffrc!X100 troffrc!X100-12 troffrc!lj4 troff!lbp troffrc!html troffrc!pdf
 .
 .\" Set the hyphenation language to 'us'.
 .do hla us
+.ig
+  Put the request '.hy' before loading the patterns as that file could
+(should) in the future contain that information to insure the correct
+hyphenation of the words used to generate them.
+..
+.do hy 14
 .
 .\" Load hyphenation patterns and exceptions.
 .do hpf hyphen.us
--
2.15.0


  For the future it is best to include the correct number in each
hyphenation file.

  The documentations (info, man) about the default '.hy' value and the
default hyphenation language (.hla) need to be updated.

Bjarni Ingi Gislason <bjarniig>
Mon 20 Nov 2017 06:40:45 AM UTC, comment #2: 

The default hyphenation value for the man macros is 14; your preferences may be defeating this default, making this (arguably) not a bug.

From groff_man(7):


.TP
.BI \-rHY= flags
Set hyphenation flags.
.
Possible values are 1\~to hyphenate without restrictions, 2\~to not
hyphenate the last word on a page, 4\~to not hyphenate the last two
characters of a word, and 8\~to not hyphenate the first two characters
of a word.
.
These values are additive; the default is\~14.


G. Branden Robinson <gbranden>
Group administrator
Mon 20 Nov 2017 05:51:13 AM UTC, comment #1: 

Please give a minimal working example.

Note that for English hyphenation you must set value 8 (`Do not hyphenate the first two characters of a word') with the `.hy' request; the patterns give false positives otherwise.  This is not a bug; it is prerequisite of the available English hyphenation patterns as generated by Knuth.

Werner LEMBERG <wl>
Group administrator
Sun 19 Nov 2017 10:01:29 PM UTC, original submission:  

  Some wrong English hyphenations that I saw today, "y-ou" and "s-ince".

  As I use "man" with the options "--no-hyphenation --no-justification", I
do not usually see any (wrong) hyphenations.

  The patterns causing this are "y1o4" and "2s1in".

  The algorithm for hyphenations in groff is either too simple or has a bug.

  The original algorithm (TeX) has hard-coded restrictions that are correct
for English, but not for all other languages.

  Patterns that begin or end with a period have a purpose.  Other patterns
should therefore not be applied to the beginning of words.

Bjarni Ingi Gislason <bjarniig>

 

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

Attach Files:
   
   
Comment:
   

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 schwarze (Posted a comment)
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-06-27 gbranden Summarysrc: the first letter hyphenated in an English word [tmac] wrong hyphenation mode used for English
    2021-07-10 gbranden StatusNeed Info Fixed
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2017-11-20 wl StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code