summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/luametatex/luametatex-languages.tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2020-10-31 00:09:22 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2020-10-31 00:09:22 +0100
commit7043cd3b7046f6a11112a5d49c4ae5e2dc0c6896 (patch)
tree92ffcd258fb29e37b4a136eb071fbfd0717be29e /doc/context/sources/general/manuals/luametatex/luametatex-languages.tex
parenta0270f13065d116355a953c6f246cbba26289fc2 (diff)
downloadcontext-7043cd3b7046f6a11112a5d49c4ae5e2dc0c6896.tar.gz
2020-10-30 22:27:00
Diffstat (limited to 'doc/context/sources/general/manuals/luametatex/luametatex-languages.tex')
-rw-r--r--doc/context/sources/general/manuals/luametatex/luametatex-languages.tex80
1 files changed, 42 insertions, 38 deletions
diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-languages.tex b/doc/context/sources/general/manuals/luametatex/luametatex-languages.tex
index 85701bdc3..d767bb5ae 100644
--- a/doc/context/sources/general/manuals/luametatex/luametatex-languages.tex
+++ b/doc/context/sources/general/manuals/luametatex/luametatex-languages.tex
@@ -190,7 +190,7 @@ kerning steps.
The start and end of a sequence of characters is signalled by a \nod {glue}, \nod
{penalty}, \nod {kern} or \nod {boundary} node. But by default also a \nod
-{hlist}, \nod {vlist}, \nod {rule}, \nod {dir}, \nod {whatsit}, \nod {ins}, and
+{hlist}, \nod {vlist}, \nod {rule}, \nod {dir}, \nod {whatsit}, \nod {insert}, and
\nod {adjust} node indicate a start or end. You can omit the last set from the
test by setting flags in \lpr {hyphenationmode}:
@@ -507,7 +507,7 @@ In the last line of the table, you see there is no \prm {discretionary} command
in the value: the command is optional in the \TEX-based input syntax. The
underlying reason for that is that it is conceivable that a whole dictionary of
words is stored as a plain text file and loaded into \LUATEX\ using one of the
-functions in the \LUA\ \type {lang} library. This loading method is quite a bit
+functions in the \LUA\ \type {language} library. This loading method is quite a bit
faster than going through the \TEX\ language primitives, but some (most?) of that
speed gain would be lost if it had to interpret command sequences while doing so.
@@ -598,7 +598,7 @@ of the implementation:
\startitem
Because there is no \quote {trie preparation} stage, language patterns never
become frozen. This means that the primitive \prm {patterns} (and its \LUA\
- counterpart \type {lang.patterns}) can be used at any time, not only in
+ counterpart \type {language.patterns}) can be used at any time, not only in
ini\TEX.
\stopitem
\startitem
@@ -622,7 +622,7 @@ of the implementation:
permits a local overload for explicit \prm {discretionary} commands. The
value current when the hyphenation pass is applied is used. When no callbacks
are used this is compatible with traditional \TEX. When you apply the \LUA\
- \type {lang.hyphenate} function the current values are used.
+ \type {language.hyphenate} function the current values are used.
\stopitem
\startitem
The hyphenation exception dictionary is maintained as key|-|value hash, and
@@ -668,7 +668,7 @@ eventually either the limitation will be removed or perhaps it will become
possible to silently ignore the excess characters (this is what happens in
\TEX82, but there the behaviour cannot be controlled).
-If you are using the \LUA\ function \type {lang.hyphenate}, you should be aware
+If you are using the \LUA\ function \type {language.hyphenate}, you should be aware
that this function expects to receive a list of \quote {character} nodes. It will
not operate properly in the presence of \quote {glyph}, \quote {ligature}, or
\quote {ghost} nodes, nor does it know how to deal with kerning.
@@ -844,7 +844,7 @@ ligatures are used. Of course kerning also complicates matters here.
\stopsection
-\startsection[title={The \type {lang} library}][library=lang]
+\startsection[title={The \type {language} library}][library=lang]
\subsection {\type {new} and \type {id}}
@@ -857,34 +857,38 @@ This library provides the interface to \LUATEX's structure representing a
language, and the associated functions.
\startfunctioncall
-<language> l = lang.new()
-<language> l = lang.new(<number> id)
+<language> l = language.new()
+<language> l = language.new(<number> id)
\stopfunctioncall
This function creates a new userdata object. An object of type \type {<language>}
-is the first argument to most of the other functions in the \type {lang} library.
-These functions can also be used as if they were object methods, using the colon
-syntax. Without an argument, the next available internal id number will be
-assigned to this object. With argument, an object will be created that links to
-the internal language with that id number.
+is the first argument to most of the other functions in the \type {language}
+library. These functions can also be used as if they were object methods, using
+the colon syntax. Without an argument, the next available internal id number will
+be assigned to this object. With argument, an object will be created that links
+to the internal language with that id number.
\startfunctioncall
-<number> n = lang.id(<language> l)
+<number> n = language.id(<language> l)
\stopfunctioncall
-The number returned is the internal \prm {language} id number this object refers to.
+The number returned is the internal \prm {language} id number this object refers
+to.
\subsection {\type {hyphenation}}
\libindex {hyphenation}
-You can hyphenate a string directly with:
+You can load exceptions with:
\startfunctioncall
-<string> n = lang.hyphenation(<language> l)
-lang.hyphenation(<language> l, <string> n)
+<string> n = language.hyphenation(<language> l)
+language.hyphenation(<language> l, <string> n)
\stopfunctioncall
+When no string is given (the first example) a string with all exceptions is
+returned.
+
\subsection {\type {clear_hyphenation} and \type {clean}}
\libindex {clear_hyphenation}
@@ -895,14 +899,14 @@ new ones. The syntax of the string is explained in~\in {section}
[patternsexceptions].
\startfunctioncall
-lang.clear_hyphenation(<language> l)
+language.clear_hyphenation(<language> l)
\stopfunctioncall
This call clears the exception dictionary (string) for this language.
\startfunctioncall
-<string> n = lang.clean(<language> l, <string> o)
-<string> n = lang.clean(<string> o)
+<string> n = language.clean(<language> l, <string> o)
+<string> n = language.clean(<string> o)
\stopfunctioncall
This function creates a hyphenation key from the supplied hyphenation value. The
@@ -916,8 +920,8 @@ dictionary file, like spell|-|checking.
\libindex {clear_patterns}
\startfunctioncall
-<string> n = lang.patterns(<language> l)
-lang.patterns(<language> l, <string> n)
+<string> n = language.patterns(<language> l)
+language.patterns(<language> l, <string> n)
\stopfunctioncall
This adds additional patterns for this language object, or returns the current
@@ -925,7 +929,7 @@ set. The syntax of this string is explained in \in {section}
[patternsexceptions].
\startfunctioncall
-lang.clear_patterns(<language> l)
+language.clear_patterns(<language> l)
\stopfunctioncall
This can be used to clear the pattern dictionary for a language.
@@ -938,8 +942,8 @@ This function sets (or gets) the value of the \TEX\ parameter
\type {\hyphenationmin}.
\startfunctioncall
-n = lang.hyphenationmin(<language> l)
-lang.hyphenationmin(<language> l, <number> n)
+n = language.hyphenationmin(<language> l)
+language.hyphenationmin(<language> l, <number> n)
\stopfunctioncall
\subsection {\type {[pre|post][ex|]hyphenchar}}
@@ -950,11 +954,11 @@ lang.hyphenationmin(<language> l, <number> n)
\libindex {postexhyphenchar}
\startfunctioncall
-<number> n = lang.prehyphenchar(<language> l)
-lang.prehyphenchar(<language> l, <number> n)
+<number> n = language.prehyphenchar(<language> l)
+language.prehyphenchar(<language> l, <number> n)
-<number> n = lang.posthyphenchar(<language> l)
-lang.posthyphenchar(<language> l, <number> n)
+<number> n = language.posthyphenchar(<language> l)
+language.posthyphenchar(<language> l, <number> n)
\stopfunctioncall
These two are used to get or set the \quote {pre|-|break} and \quote
@@ -962,11 +966,11 @@ These two are used to get or set the \quote {pre|-|break} and \quote
intial values are decimal 45 (hyphen) and decimal~0 (indicating emptiness).
\startfunctioncall
-<number> n = lang.preexhyphenchar(<language> l)
-lang.preexhyphenchar(<language> l, <number> n)
+<number> n = language.preexhyphenchar(<language> l)
+language.preexhyphenchar(<language> l, <number> n)
-<number> n = lang.postexhyphenchar(<language> l)
-lang.postexhyphenchar(<language> l, <number> n)
+<number> n = language.postexhyphenchar(<language> l)
+language.postexhyphenchar(<language> l, <number> n)
\stopfunctioncall
These gets or set the \quote {pre|-|break} and \quote {post|-|break} hyphen
@@ -983,8 +987,8 @@ The next call inserts hyphenation points (discretionary nodes) in a node list. I
are proper nodes, regardless of possible other errors.
\startfunctioncall
-<boolean> success = lang.hyphenate(<node> head)
-<boolean> success = lang.hyphenate(<node> head, <node> tail)
+<boolean> success = language.hyphenate(<node> head)
+<boolean> success = language.hyphenate(<node> head, <node> tail)
\stopfunctioncall
Hyphenation works only on \quote {characters}, a special subtype of all the glyph
@@ -1000,8 +1004,8 @@ more details.
The following two commands can be used to set or query hj codes:
\startfunctioncall
-lang.sethjcode(<language> l, <number> char, <number> usedchar)
-<number> usedchar = lang.gethjcode(<language> l, <number> char)
+language.sethjcode(<language> l, <number> char, <number> usedchar)
+<number> usedchar = language.gethjcode(<language> l, <number> char)
\stopfunctioncall
When you set a hjcode the current sets get initialized unless the set was already