ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Hyphenation in multi-language projects
@ 2022-09-12 15:11 Steffen Wolfrum via ntg-context
  2022-09-12 15:45 ` Denis Maier via ntg-context
  2022-09-14  6:35 ` Max Chernoff via ntg-context
  0 siblings, 2 replies; 13+ messages in thread
From: Steffen Wolfrum via ntg-context @ 2022-09-12 15:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Steffen Wolfrum

Hi,

please have a look at this minimal example.

The idea is to set the hyphenation for certain words regardless of the language that is used in the surrounding paragraphs.

In this example it should stay: «steff-en»

How do i set this to all non-english paragraphs (without using \hyphenation on each language-switch)?

Best,
Steffen

—

\starttext

\setuppapersize[A6][A6]

\mainlanguage[en]

\startexceptions
steff-en
\stopexceptions

english text english text english teste: steffen

\start\language[it]
italian text italian text italian teste: steffen
\stop

\start\language[it]\hyphenation{steff-en}
italian text italian text italian teste: steffen
\stop

\stoptext

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hyphenation in multi-language projects
  2022-09-12 15:11 Hyphenation in multi-language projects Steffen Wolfrum via ntg-context
@ 2022-09-12 15:45 ` Denis Maier via ntg-context
  2022-09-14  6:35 ` Max Chernoff via ntg-context
  1 sibling, 0 replies; 13+ messages in thread
From: Denis Maier via ntg-context @ 2022-09-12 15:45 UTC (permalink / raw)
  To: ntg-context; +Cc: denis.maier, context

Untested: try specifying the exceptions first, load mainlanguage later?

Or, use \hyphenation?

Have you tested any if these?

Or, you could use multiple exception blocks...
\startexceptions[it]
Steff-en
\stopexceptions

\startexceptions[en]
Steff-en
\stopexceptions




________________________________________
Von: ntg-context <ntg-context-bounces@ntg.nl> im Auftrag von Steffen Wolfrum via ntg-context <ntg-context@ntg.nl>
Gesendet: Montag, 12. September 2022 17:11:55
An: mailing list for ConTeXt users
Cc: Steffen Wolfrum
Betreff: [NTG-context] Hyphenation in multi-language projects

Hi,

please have a look at this minimal example.

The idea is to set the hyphenation for certain words regardless of the language that is used in the surrounding paragraphs.

In this example it should stay: «steff-en»

How do i set this to all non-english paragraphs (without using \hyphenation on each language-switch)?

Best,
Steffen

—

\starttext

\setuppapersize[A6][A6]

\mainlanguage[en]

\startexceptions
steff-en
\stopexceptions

english text english text english teste: steffen

\start\language[it]
italian text italian text italian teste: steffen
\stop

\start\language[it]\hyphenation{steff-en}
italian text italian text italian teste: steffen
\stop

\stoptext

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hyphenation in multi-language projects
  2022-09-12 15:11 Hyphenation in multi-language projects Steffen Wolfrum via ntg-context
  2022-09-12 15:45 ` Denis Maier via ntg-context
@ 2022-09-14  6:35 ` Max Chernoff via ntg-context
  2022-09-14  6:40   ` Steffen Wolfrum via ntg-context
  1 sibling, 1 reply; 13+ messages in thread
From: Max Chernoff via ntg-context @ 2022-09-14  6:35 UTC (permalink / raw)
  To: ntg-context; +Cc: Max Chernoff, context


Hi Steffen,

> The idea is to set the hyphenation for certain words regardless of the
> language that is used in the surrounding paragraphs.
> 
> In this example it should stay: «steff-en»
> 
> How do i set this to all non-english paragraphs (without using
> \hyphenation on each language-switch)?

You can use \replaceword:

   \starttext
   
   \setuppapersize[A6][A6]
   
   \mainlanguage[en]
   
   \replaceword[hyphenations][steffen][steff{-}{}{}en]
   \setreplacements[hyphenations]
   
   english text english text english teste: steffen steffen
   
   \start\language[it]
   italian text italian text italian teste: steffen steffen
   \stop
   
   \stoptext
   
-- Max
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hyphenation in multi-language projects
  2022-09-14  6:35 ` Max Chernoff via ntg-context
@ 2022-09-14  6:40   ` Steffen Wolfrum via ntg-context
  2022-09-14  6:50     ` Max Chernoff via ntg-context
  0 siblings, 1 reply; 13+ messages in thread
From: Steffen Wolfrum via ntg-context @ 2022-09-14  6:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Hans Hagen; +Cc: Steffen Wolfrum, Hans Hagen

… \replaceword should be the correct way for proper hyphenation??

st.


> Am 14.09.2022 um 08:35 schrieb Max Chernoff <mseven@telus.net>:
> 
> 
> Hi Steffen,
> 
>> The idea is to set the hyphenation for certain words regardless of the
>> language that is used in the surrounding paragraphs.
>> 
>> In this example it should stay: «steff-en»
>> 
>> How do i set this to all non-english paragraphs (without using
>> \hyphenation on each language-switch)?
> 
> You can use \replaceword:
> 
> \starttext
> 
> \setuppapersize[A6][A6]
> 
> \mainlanguage[en]
> 
> \replaceword[hyphenations][steffen][steff{-}{}{}en]
> \setreplacements[hyphenations]
> 
> english text english text english teste: steffen steffen
> 
> \start\language[it]
> italian text italian text italian teste: steffen steffen
> \stop
> 
> \stoptext
> 
> -- Max

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hyphenation in multi-language projects
  2022-09-14  6:40   ` Steffen Wolfrum via ntg-context
@ 2022-09-14  6:50     ` Max Chernoff via ntg-context
  2022-09-14  7:19       ` Denis Maier via ntg-context
  0 siblings, 1 reply; 13+ messages in thread
From: Max Chernoff via ntg-context @ 2022-09-14  6:50 UTC (permalink / raw)
  To: ntg-context; +Cc: Max Chernoff, context

Hi Steffen,

> … \replaceword should be the correct way for proper hyphenation??

Well I'm not sure if it's "correct", but it seems to work. Based on my
testing, having three subsequent sets of groups ({A}{B}{C}) is converted
to a discretionary. The discretionary hyphen "\-" is equivalent to the
Plain TeX command "\discretionary{-}{}{}", so 

   \replaceword[hyphenations][steffen][steff{-}{}{}en]
   
acts just like "steff\-en". TeX won't otherwise hyphenate a word with
discretionaries, so this means that "steff-en" will be the only allowable
hyphenation.

-- Max
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hyphenation in multi-language projects
  2022-09-14  6:50     ` Max Chernoff via ntg-context
@ 2022-09-14  7:19       ` Denis Maier via ntg-context
  2022-09-14 14:44         ` Steffen Wolfrum via ntg-context
  0 siblings, 1 reply; 13+ messages in thread
From: Denis Maier via ntg-context @ 2022-09-14  7:19 UTC (permalink / raw)
  To: ntg-context; +Cc: denis.maier, mseven, context

> -----Ursprüngliche Nachricht-----
> Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von Max
> Chernoff via ntg-context
> Gesendet: Mittwoch, 14. September 2022 08:51
> An: ntg-context@ntg.nl
> Cc: Max Chernoff <mseven@telus.net>; context@st.estfiles.de
> Betreff: Re: [NTG-context] Hyphenation in multi-language projects
> 
> Hi Steffen,
> 
> > … \replaceword should be the correct way for proper hyphenation??
> 
> Well I'm not sure if it's "correct", but it seems to work. Based on my testing,
> having three subsequent sets of groups ({A}{B}{C}) is converted to a
> discretionary. The discretionary hyphen "\-" is equivalent to the Plain TeX
> command "\discretionary{-}{}{}", so
> 
>    \replaceword[hyphenations][steffen][steff{-}{}{}en]
> 
> acts just like "steff\-en". TeX won't otherwise hyphenate a word with
> discretionaries, so this means that "steff-en" will be the only allowable
> hyphenation.

Just one caveat though. IIRC, Hans has mentioned that this kind of stuff is slower than using the hyphenation engine directly. (That's why he has reimplemented the ligature suppression mechanism on the hyphenation level, rather than acting on the node list.) 

Best,
Denis
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hyphenation in multi-language projects
  2022-09-14  7:19       ` Denis Maier via ntg-context
@ 2022-09-14 14:44         ` Steffen Wolfrum via ntg-context
  2022-09-14 14:54           ` Denis Maier via ntg-context
  0 siblings, 1 reply; 13+ messages in thread
From: Steffen Wolfrum via ntg-context @ 2022-09-14 14:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Steffen Wolfrum, Hans Hagen

Isn’t there a way to list exceptions that will work in *all* languages?

Steffen


> Am 14.09.2022 um 09:19 schrieb Denis Maier via ntg-context <ntg-context@ntg.nl>:
> 
>> -----Ursprüngliche Nachricht-----
>> Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von Max
>> Chernoff via ntg-context
>> Gesendet: Mittwoch, 14. September 2022 08:51
>> An: ntg-context@ntg.nl
>> Cc: Max Chernoff <mseven@telus.net>; context@st.estfiles.de
>> Betreff: Re: [NTG-context] Hyphenation in multi-language projects
>> 
>> Hi Steffen,
>> 
>>> … \replaceword should be the correct way for proper hyphenation??
>> 
>> Well I'm not sure if it's "correct", but it seems to work. Based on my testing,
>> having three subsequent sets of groups ({A}{B}{C}) is converted to a
>> discretionary. The discretionary hyphen "\-" is equivalent to the Plain TeX
>> command "\discretionary{-}{}{}", so
>> 
>>  \replaceword[hyphenations][steffen][steff{-}{}{}en]
>> 
>> acts just like "steff\-en". TeX won't otherwise hyphenate a word with
>> discretionaries, so this means that "steff-en" will be the only allowable
>> hyphenation.
> 
> Just one caveat though. IIRC, Hans has mentioned that this kind of stuff is slower than using the hyphenation engine directly. (That's why he has reimplemented the ligature suppression mechanism on the hyphenation level, rather than acting on the node list.) 
> 
> Best,
> Denis
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hyphenation in multi-language projects
  2022-09-14 14:44         ` Steffen Wolfrum via ntg-context
@ 2022-09-14 14:54           ` Denis Maier via ntg-context
  2022-09-14 17:38             ` Steffen Wolfrum via ntg-context
  2022-09-14 17:40             ` Pablo Rodriguez via ntg-context
  0 siblings, 2 replies; 13+ messages in thread
From: Denis Maier via ntg-context @ 2022-09-14 14:54 UTC (permalink / raw)
  To: ntg-context; +Cc: denis.maier, pragma, context

> -----Ursprüngliche Nachricht-----
> Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von Steffen
> Wolfrum via ntg-context
> Gesendet: Mittwoch, 14. September 2022 16:45
> An: mailing list for ConTeXt users <ntg-context@ntg.nl>
> Cc: Steffen Wolfrum <context@st.estfiles.de>; Hans Hagen
> <pragma@wxs.nl>
> Betreff: Re: [NTG-context] Hyphenation in multi-language projects
> 
> Isn’t there a way to list exceptions that will work in *all* languages?

I thought that \hyphenation would work like that, or \startexceptions without a language code. Apparently that's not the case.

Denis


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hyphenation in multi-language projects
  2022-09-14 14:54           ` Denis Maier via ntg-context
@ 2022-09-14 17:38             ` Steffen Wolfrum via ntg-context
  2022-09-14 17:40             ` Pablo Rodriguez via ntg-context
  1 sibling, 0 replies; 13+ messages in thread
From: Steffen Wolfrum via ntg-context @ 2022-09-14 17:38 UTC (permalink / raw)
  To: denis.maier; +Cc: Steffen Wolfrum, ntg-context, pragma

a bug?

st.


> Am 14.09.2022 um 16:54 schrieb denis.maier@unibe.ch:
> 
>> -----Ursprüngliche Nachricht-----
>> Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von Steffen
>> Wolfrum via ntg-context
>> Gesendet: Mittwoch, 14. September 2022 16:45
>> An: mailing list for ConTeXt users <ntg-context@ntg.nl>
>> Cc: Steffen Wolfrum <context@st.estfiles.de>; Hans Hagen
>> <pragma@wxs.nl>
>> Betreff: Re: [NTG-context] Hyphenation in multi-language projects
>> 
>> Isn’t there a way to list exceptions that will work in *all* languages?
> 
> I thought that \hyphenation would work like that, or \startexceptions without a language code. Apparently that's not the case.
> 
> Denis
> 
> 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hyphenation in multi-language projects
  2022-09-14 14:54           ` Denis Maier via ntg-context
  2022-09-14 17:38             ` Steffen Wolfrum via ntg-context
@ 2022-09-14 17:40             ` Pablo Rodriguez via ntg-context
  2022-10-24 13:08               ` Fwd: " Steffen Wolfrum via ntg-context
  1 sibling, 1 reply; 13+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2022-09-14 17:40 UTC (permalink / raw)
  To: Denis Maier via ntg-context; +Cc: Pablo Rodriguez

On 9/14/22 16:54, Denis Maier via ntg-context wrote:
>> [...]
>> Isn’t there a way to list exceptions that will work in *all*
>> languages?
>
> I thought that \hyphenation would work like that, or \startexceptions
> without a language code. Apparently that's not the case.

\hyphenation only works for the given language:

  \hyphenation{macOS}
  \starttext
  \startTEXpage[offset=1em]
  \currentlanguage:
  \hyphenatedword{macOS}

  \startlanguage[fr]
  \currentlanguage:
  \hyphenatedword{macOS}
  \stoplanguage
  \stopTEXpage
  \stoptext

But I’d say that \registerhyphenationexception[macOS] was
language-independent for me some time ago. (Now it seems to work like
\hyphenation.)

In any case, \registerhyphenationexception seems to have issues with
ligatures:

  \setuphyphenation[method=traditional]
  \registerhyphenationexception[steff-en macOS]
  \registerhyphenationexception[it][steff-en macOS]

  \starttext
  \startTEXpage[offset=1em]
  \currentlanguage:
  \hyphenatedword{steffen macOS}

  \startlanguage[it]
  \currentlanguage:
  \hyphenatedword{steffen macOS}
  \stoplanguage
  \stopTEXpage
  \stoptext

If there isn’t a command to add language-indepented hyphenation
exceptions or patterns, one for proper names (for people, products or
companies) would be really useful.

Just in case Hans or other wizard may take a look at this,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Fwd:  Hyphenation in multi-language projects
  2022-09-14 17:40             ` Pablo Rodriguez via ntg-context
@ 2022-10-24 13:08               ` Steffen Wolfrum via ntg-context
  2022-10-24 15:09                 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 13+ messages in thread
From: Steffen Wolfrum via ntg-context @ 2022-10-24 13:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Steffen Wolfrum


[-- Attachment #1.1: Type: text/plain, Size: 2058 bytes --]



> Anfang der weitergeleiteten Nachricht:
> 
> Von: Pablo Rodriguez via ntg-context <ntg-context@ntg.nl <mailto:ntg-context@ntg.nl>>
> Betreff: Aw: [NTG-context] Hyphenation in multi-language projects
> Datum: 14. September 2022 um 19:40:53 MESZ
> An: Denis Maier via ntg-context <ntg-context@ntg.nl <mailto:ntg-context@ntg.nl>>
> Kopie: Pablo Rodriguez <oinos@gmx.es <mailto:oinos@gmx.es>>
> Antwort an: mailing list for ConTeXt users <ntg-context@ntg.nl <mailto:ntg-context@ntg.nl>>
> 
> On 9/14/22 16:54, Denis Maier via ntg-context wrote:
>>> [...]
>>> Isn’t there a way to list exceptions that will work in *all*
>>> languages?
>> 
>> I thought that \hyphenation would work like that, or \startexceptions
>> without a language code. Apparently that's not the case.
> 
> \hyphenation only works for the given language:
> 
>  \hyphenation{macOS}
>  \starttext
>  \startTEXpage[offset=1em]
>  \currentlanguage:
>  \hyphenatedword{macOS}
> 
>  \startlanguage[fr]
>  \currentlanguage:
>  \hyphenatedword{macOS}
>  \stoplanguage
>  \stopTEXpage
>  \stoptext
> 
> But I’d say that \registerhyphenationexception[macOS] was
> language-independent for me some time ago. (Now it seems to work like
> \hyphenation.)
> 
> In any case, \registerhyphenationexception seems to have issues with
> ligatures:
> 
>  \setuphyphenation[method=traditional]
>  \registerhyphenationexception[steff-en macOS]
>  \registerhyphenationexception[it][steff-en macOS]
> 
>  \starttext
>  \startTEXpage[offset=1em]
>  \currentlanguage:
>  \hyphenatedword{steffen macOS}
> 
>  \startlanguage[it]
>  \currentlanguage:
>  \hyphenatedword{steffen macOS}
>  \stoplanguage
>  \stopTEXpage
>  \stoptext
> 
> If there isn’t a command to add language-indepented hyphenation
> exceptions or patterns, one for proper names (for people, products or
> companies) would be really useful.
> 
> Just in case Hans or other wizard may take a look at this,
> 
> Pablo


Hans, is there any news regarding Pablos wish?

Steffen


[-- Attachment #1.2: Type: text/html, Size: 5734 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Fwd:  Hyphenation in multi-language projects
  2022-10-24 13:08               ` Fwd: " Steffen Wolfrum via ntg-context
@ 2022-10-24 15:09                 ` Hans Hagen via ntg-context
  2022-10-24 16:15                   ` Pablo Rodriguez via ntg-context
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Hagen via ntg-context @ 2022-10-24 15:09 UTC (permalink / raw)
  To: Steffen Wolfrum, mailing list for ConTeXt users; +Cc: Hans Hagen

On 10/24/2022 3:08 PM, Steffen Wolfrum wrote:
> 
> 
>> Anfang der weitergeleiteten Nachricht:
>>
>> *Von: *Pablo Rodriguez via ntg-context <ntg-context@ntg.nl 
>> <mailto:ntg-context@ntg.nl>>
>> *Betreff: **Aw: [NTG-context] Hyphenation in multi-language projects*
>> *Datum: *14. September 2022 um 19:40:53 MESZ
>> *An: *Denis Maier via ntg-context <ntg-context@ntg.nl 
>> <mailto:ntg-context@ntg.nl>>
>> *Kopie: *Pablo Rodriguez <oinos@gmx.es <mailto:oinos@gmx.es>>
>> *Antwort an: *mailing list for ConTeXt users <ntg-context@ntg.nl 
>> <mailto:ntg-context@ntg.nl>>
>>
>> On 9/14/22 16:54, Denis Maier via ntg-context wrote:
>>>> [...]
>>>> Isn’t there a way to list exceptions that will work in *all*
>>>> languages?
>>>
>>> I thought that \hyphenation would work like that, or \startexceptions
>>> without a language code. Apparently that's not the case.
>>
>> \hyphenation only works for the given language:
>>
>>  \hyphenation{macOS}
>>  \starttext
>>  \startTEXpage[offset=1em]
>>  \currentlanguage:
>>  \hyphenatedword{macOS}
>>
>>  \startlanguage[fr]
>>  \currentlanguage:
>>  \hyphenatedword{macOS}
>>  \stoplanguage
>>  \stopTEXpage
>>  \stoptext
>>
>> But I’d say that \registerhyphenationexception[macOS] was
>> language-independent for me some time ago. (Now it seems to work like
>> \hyphenation.)
>>
>> In any case, \registerhyphenationexception seems to have issues with
>> ligatures:
>>
>>  \setuphyphenation[method=traditional]
>>  \registerhyphenationexception[steff-en macOS]
>>  \registerhyphenationexception[it][steff-en macOS]
>>
>>  \starttext
>>  \startTEXpage[offset=1em]
>>  \currentlanguage:
>>  \hyphenatedword{steffen macOS}
>>
>>  \startlanguage[it]
>>  \currentlanguage:
>>  \hyphenatedword{steffen macOS}
>>  \stoplanguage
>>  \stopTEXpage
>>  \stoptext
>>
>> If there isn’t a command to add language-indepented hyphenation
>> exceptions or patterns, one for proper names (for people, products or
>> companies) would be really useful.
>>
>> Just in case Hans or other wizard may take a look at this,
>>
>> Pablo
> 
> 
> Hans, is there any news regarding Pablos wish?
no, because I'm in a different tex mode ...

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Fwd: Hyphenation in multi-language projects
  2022-10-24 15:09                 ` Hans Hagen via ntg-context
@ 2022-10-24 16:15                   ` Pablo Rodriguez via ntg-context
  0 siblings, 0 replies; 13+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2022-10-24 16:15 UTC (permalink / raw)
  To: Hans Hagen via ntg-context; +Cc: Pablo Rodriguez

On 10/24/22 17:09, Hans Hagen via ntg-context wrote:
>> [...]
>> Hans, is there any news regarding Pablos wish?
> no, because I'm in a different tex mode ...

Steffen,

meanwhile, a way of crappy cheating...

  \setuphyphenation[method=traditional]
  \doloopoverlist{en,nl,de,es,it,fr,da,fi}
    {\registerhyphenationexception[\recursestring][Joha-nnes]}
  \starttext
  \startTEXpage[offset=1em]
  \hyphenatedword{Johannes}\\
  \nl \hyphenatedword{Johannes}\\
  \de \hyphenatedword{Johannes}\\
  \es \hyphenatedword{Johannes}\\
  \language[it] \hyphenatedword{Johannes}\\
  \language[fi] \hyphenatedword{Johannes}\\
  \fr \hyphenatedword{Johannes}\\
  \da \hyphenatedword{Johannes}\\
  \stopTEXpage
  \stoptext

Ugly code, but it might do the trick in some scenarios.

Just in case it might work,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-10-24 16:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 15:11 Hyphenation in multi-language projects Steffen Wolfrum via ntg-context
2022-09-12 15:45 ` Denis Maier via ntg-context
2022-09-14  6:35 ` Max Chernoff via ntg-context
2022-09-14  6:40   ` Steffen Wolfrum via ntg-context
2022-09-14  6:50     ` Max Chernoff via ntg-context
2022-09-14  7:19       ` Denis Maier via ntg-context
2022-09-14 14:44         ` Steffen Wolfrum via ntg-context
2022-09-14 14:54           ` Denis Maier via ntg-context
2022-09-14 17:38             ` Steffen Wolfrum via ntg-context
2022-09-14 17:40             ` Pablo Rodriguez via ntg-context
2022-10-24 13:08               ` Fwd: " Steffen Wolfrum via ntg-context
2022-10-24 15:09                 ` Hans Hagen via ntg-context
2022-10-24 16:15                   ` Pablo Rodriguez via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).