Re: [NTG-context] Hyphenation in multi-language projects
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 ___
Re: [NTG-context] Hyphenation in multi-language projects
a bug? st. > Am 14.09.2022 um 16:54 schrieb denis.ma...@unibe.ch: > >> -Ursprüngliche Nachricht- >> Von: ntg-context Im Auftrag von Steffen >> Wolfrum via ntg-context >> Gesendet: Mittwoch, 14. September 2022 16:45 >> An: mailing list for ConTeXt users >> Cc: Steffen Wolfrum ; Hans Hagen >> >> 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 ___
Re: [NTG-context] Hyphenation in multi-language projects
> -Ursprüngliche Nachricht- > Von: ntg-context Im Auftrag von Steffen > Wolfrum via ntg-context > Gesendet: Mittwoch, 14. September 2022 16:45 > An: mailing list for ConTeXt users > Cc: Steffen Wolfrum ; Hans Hagen > > 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 ___
Re: [NTG-context] Hyphenation in multi-language projects
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 > : > >> -Ursprüngliche Nachricht- >> Von: ntg-context Im Auftrag von Max >> Chernoff via ntg-context >> Gesendet: Mittwoch, 14. September 2022 08:51 >> An: ntg-context@ntg.nl >> Cc: Max Chernoff ; cont...@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 ___
Re: [NTG-context] Hyphenation in multi-language projects
> -Ursprüngliche Nachricht- > Von: ntg-context Im Auftrag von Max > Chernoff via ntg-context > Gesendet: Mittwoch, 14. September 2022 08:51 > An: ntg-context@ntg.nl > Cc: Max Chernoff ; cont...@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 ___
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. -- 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 ___
Re: [NTG-context] Hyphenation in multi-language projects
… \replaceword should be the correct way for proper hyphenation?? st. > Am 14.09.2022 um 08:35 schrieb Max Chernoff : > > > 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 ___
Re: [NTG-context] Hyphenation in multi-language projects
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 ___
Re: [NTG-context] Hyphenation in multi-language projects
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 im Auftrag von Steffen Wolfrum via ntg-context 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 ___
[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 ___