diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/s-lan-06.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/s-lan-06.mkiv | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/s-lan-06.mkiv b/Master/texmf-dist/tex/context/base/s-lan-06.mkiv new file mode 100644 index 00000000000..43d59a2d131 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/s-lan-06.mkiv @@ -0,0 +1,53 @@ +%D \module +%D [ file=s-lan-06, +%D version=2013.03.22, +%D title=\CONTEXT\ Style File, +%D subtitle=Language Environment 6, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startluacode + +languages.tracers = languages.tracers or { } + +function languages.tracers.showfrequencies(language) + local t = languages.frequencies.getdata(language or "en") + context.starttabulate { "|lT|cw(2em)|r|" } + context.NC() + context.formatted.rlap("%s: %p",t.language,languages.frequencies.averagecharwidth(t.language)) + context.NC() + context.NC() + context.NR() + context.HL() + for k, v in table.sortedhash(t.frequencies) do + context.NC() + context("%U",k) + context.NC() + context("%c",k) + context.NC() + context("%0.3f",v) + context.NC() + context.NR() + end + context.stoptabulate() +end + +\stopluacode + +\unexpanded\def\ShowLanguageFrequencies#1% + {\ctxlua{languages.tracers.showfrequencies("#1")}} + +\continueifinputfile{s-lan-06.mkiv} + +\starttext + + \hsize65\averagecharwidth \input ward \par + + \ShowLanguageFrequencies\currentmainlanguage + +\stoptext |