ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Paul Hoffman <nkuitse@nkuitse.com>
To: ntg-context@ntg.nl
Subject: How to define a new language?
Date: Wed, 27 Feb 2019 17:05:05 -0500	[thread overview]
Message-ID: <20190227220505.GA6876@trot> (raw)

I'm trying to define a new language for use in a bilingual document, but 
my hyphenation patterns are being ignored and I'm sure I must be doing 
something wrong.

I've devised a minimal example that should hyphenate between vowels but 
doesn't.  Here's the hyphenation patterns file:

----------------------------- lang-foo.pat -----------------------------
% Hyphenation patterns for Foo.
\begingroup
\patterns{
a1a a1e a1i a1o a1u
e1a e1e e1i e1o e1u
i1a i1e i1i i1o i1u
o1a o1e o1i o1o o1u
u1a u1e u1i u1o u1u
}
\endgroup
------------------------------------------------------------------------

I tried to convert this to Lua code but couldn't figure out the right 
invocation of _mtxrun --script pattern --convert_.

Then I wrote a minimal Context file and hoped it would pick up 
lang-foo.pat anyhow:

----------------------------- test-foo.tex -----------------------------
\installlanguage[foo][
    spacing=broad,
    leftsentence=---,
    rightsentence=---,
    leftsubsentence=---,
    rightsubsentence=---,
    leftquote=\upperleftsinglesixquote,
    rightquote=\upperrightsingleninequote,
    leftquotation=\upperleftdoublesixquote,
    rightquotation=\upperrightdoubleninequote,
    date={month,\ ,day,{,\ },year},
    state=stop,
]
\mainlanguage[foo]
\setuppapersize[A6]
\setupalign[hyphenated,morehyphenation,flushleft]
\starttext
umleoeoikaoukkoiiaaiewuewniimoaralkokolwwuiuirmlkipetnoaeteuntoilooooamm
uuuauemepokawpoieoomtkeaipeailloaukoiwaeuaewurawiueanwtaoaoemmuuonwleaue
mrtmuweokmikariurtlluiraapnkowuaueolmrneraiiioeauemmaamauiiolluwrltounte
aaaunnoitwueemwlniowotuauwomaupaapwtawiikiuolnrolouletouunwptoioououoael
kiitinouoeolopewourtuineuaermnmmioaiuienkewuiaaklinipprurainouioiomuwokr
koriiaieulkppwwieoemlipiakinppprnpaiaaekapnpatritotoeormaetualeonemlppau
earoeauoiimekoilliiuomirnrwarpupieiilaaueeoaekwriummikpatakeairolwpiaoaa
tniweuiineeetuiektpalukluanetoiklwnemutlonnuaalpnelpniiuiutmaoakmkoiomia
ineioporrieopatakomonipiuwuiwiiaueiueoluoeaaiootwuekinkwawrrwwppilewoioo
itroreraeonkeuiaawalunnueoreiaaeewknailaeomomilkruruekuonkaonwwiieunonow
\stoptext
------------------------------------------------------------------------

It does seem to see lang-foo.pat:

$ context --pdf test-foo.tex | fgrep patterns
mkiv lua stats  > loaded patterns: en::2 foo::67, load time: 0.000

But in the resulting PDF, nothing is hyphenated.  (I'll post the PDF if 
anyone really wants to see it.)

Here's my _context --version_ output:

mtx-context     | ConTeXt Process Management 1.02
mtx-context     |
mtx-context     | main context file: /usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context     | current version: 2018.01.19 13:42

Can someone point me to my mistake?

Thanks in advance,

Paul.

-- 
Paul Hoffman <nkuitse@nkuitse.com>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

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

             reply	other threads:[~2019-02-27 22:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 22:05 Paul Hoffman [this message]
2019-02-28 16:19 ` Paul Hoffman
2019-02-28 17:19 ` Wolfgang Schuster
2019-02-28 18:23   ` Paul Hoffman
2019-03-01 10:04     ` Arthur Reutenauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190227220505.GA6876@trot \
    --to=nkuitse@nkuitse.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).