lang-wrd.mkiv /size: 1761 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [       file=lang-wrd,
3%D        version=2006.XX.XX,
4%D          title=\CONTEXT\ Language Macros,
5%D       subtitle=Checking,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D Experimental.
15
16\writestatus{loading}{ConTeXt Language Macros / Checking}
17
18\registerctxluafile{lang-wrd}{}
19
20\unprotect
21
22% \loadspellchecklist[en][words-en.txt]
23% \loadspellchecklist[us][words-en.txt]
24% \loadspellchecklist[nl][words-nl.txt]
25% \setupspellchecking[state=start,method=1]
26%
27% \setupspellchecking[state=start,method=2]
28% ...
29% \typefile{\jobname.words}
30%
31% beware, maybe some day we will honour grouping
32%
33% 1: spell checking
34% 2: word counting
35% 3: language coloring
36
37\installcorenamespace{spell}
38
39\installdirectcommandhandler \??spell {spellchecking}
40
41\appendtoks
42   \doifelse{\directspellcheckingparameter\c!state}\v!start
43     {\clf_enablespellchecking
44        method {\directspellcheckingparameter\c!method}%
45        list   {\directspellcheckingparameter\c!list}%
46      \relax}
47     {\clf_disablespellchecking}%
48\to \everysetupspellchecking
49
50\unexpanded\def\loadspellchecklist
51  {\dodoubleempty\lang_spellchecking_load_list}
52
53\def\lang_spellchecking_load_list[#1][#2]%
54  {\clf_loadspellchecklist{#1}{#2}}
55
56\setupspellchecking
57  [\c!state=\v!stop,
58   \c!method=1,
59   \c!list=]
60
61\definecolor[word:yes]    [g=.75]
62\definecolor[word:no]     [r=.75]
63
64%definecolor[word:unset]  [s=.75]
65\definecolor[word:en]     [b=.75]
66\definecolor[word:de]     [r=.75]
67\definecolor[word:nl]     [g=.75]
68\definecolor[word:unknown][r=.75,g=.75]
69
70\protect \endinput
71