diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-17 19:31:15 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-17 19:31:15 +0200 |
commit | 2017d30b4ca772c8eeac4fc0eb9b54e547a9a1d8 (patch) | |
tree | d96df31f305a095c078ea5fb9f639ca34ac36c12 /tex/context/modules/mkiv/s-languages-words.lua | |
parent | 53ff76b73cd1f373ecdfb0f7f17df6f352621d6e (diff) | |
download | context-2017d30b4ca772c8eeac4fc0eb9b54e547a9a1d8.tar.gz |
2016-05-17 19:25:00
Diffstat (limited to 'tex/context/modules/mkiv/s-languages-words.lua')
-rw-r--r-- | tex/context/modules/mkiv/s-languages-words.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tex/context/modules/mkiv/s-languages-words.lua b/tex/context/modules/mkiv/s-languages-words.lua new file mode 100644 index 000000000..ea7aee87b --- /dev/null +++ b/tex/context/modules/mkiv/s-languages-words.lua @@ -0,0 +1,32 @@ +if not modules then modules = { } end modules ['s-languages-words'] = { + version = 1.001, + comment = "companion to s-languages-words.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +moduledata.languages = moduledata.languages or { } +moduledata.languages.words = moduledata.languages.words or { } + +function moduledata.languages.words.showwords(specification) + local filename = specification.filename or file.addsuffix(tex.jobname,"words") + if lfs.isfile(filename) then + local w = dofile(filename) + if w then + -- table.print(w) + for cname, category in table.sortedpairs(w.categories) do + for lname, language in table.sortedpairs(category.languages) do + context.bold(string.format("category: %s, language: %s, total: %s, unique: %s:", + cname, lname, language.total or 0, language.unique or 0) + ) + for word, n in table.sortedpairs(language.list) do + context(" %s (%s)",word,n) + end + context.par() + end + end + end + end +end + |