Debian Codegraph @

texmf-dist/tex/generic/babel/babel-data-cjk.lua

raw
1 --
2 -- This is file `babel-data-cjk.lua',
3 -- generated with the docstrip utility.
4 --
5 -- The original source files were:
6 --
7 -- babel.dtx (with options: `cjkdata')
8 --
9 --
10 -- Copyright (C) 2012-2026 Javier Bezos and Johannes L. Braams.
11 -- Copyright (C) 1989-2012 Johannes L. Braams and
12 -- any individual authors listed elsewhere in this file.
13 -- All rights reserved.
14 --
15 --
16 -- This file is part of the Babel system.
17 -- --------------------------------------
18 --
19 -- It may be distributed and/or modified under the
20 -- conditions of the LaTeX Project Public License, either version 1.3
21 -- of this license or (at your option) any later version.
22 -- The latest version of this license is in
23 -- http://www.latex-project.org/lppl.txt
24 -- and version 1.3 or later is part of all distributions of LaTeX
25 -- version 2003/12/01 or later.
26 --
27 -- This work has the LPPL maintenance status "maintained".
28 --
29 -- The Current Maintainer of this work is Javier Bezos.
30 --
31 -- The list of derived (unpacked) files belonging to the distribution
32 -- and covered by LPPL is defined by the unpacking scripts (with
33 -- extension |.ins|) which are part of the distribution.
34 --
35 Babel.cjk_characters = {
36 [0x0021]={c='ex'},
37 [0x0022]={c='qu'},
38 [0x0024]={c='pr'},
39 [0x0025]={c='po'},
40 [0x0027]={c='qu'},
41 [0x0028]={c='op'},
42 [0x0029]={c='cp'},
43 [0x002B]={c='pr'},
44 [0x002C]={c='is'},
45 [0x002D]={c='hy'},
46 [0x002E]={c='is'},
47 [0x002F]={c='sy'},
48 [0x003A]={c='is'},
49 [0x003B]={c='is'},
50 [0x003F]={c='ex'},
51 [0x005B]={c='op'},
52 [0x005C]={c='pr'},
53 [0x005D]={c='cp'},
54 [0x007B]={c='op'},
55 [0x007D]={c='cl'},
56 [0x00A1]={c='op'},
57 [0x00A2]={c='po'},
58 [0x00A3]={c='pr'},
59 [0x00A4]={c='pr'},
60 [0x00A5]={c='pr'},
61 [0x00AB]={c='qu'},
62 [0x00B0]={c='po'},
63 [0x00B1]={c='pr'},
64 [0x00BB]={c='qu'},
65 [0x2018]={c='qu'},
66 [0x2019]={c='qu'},
67 [0x201A]={c='op'},
68 [0x201B]={c='qu'},
69 [0x201C]={c='qu'},
70 [0x201D]={c='qu'},
71 [0x201E]={c='op'},
72 [0x201F]={c='qu'},
73 [0x2024]={c='in'},
74 [0x2025]={c='in'},
75 [0x2026]={c='in'},
76 [0x2030]={c='po'},
77 [0x2031]={c='po'},
78 [0x2032]={c='po'},
79 [0x2033]={c='po'},
80 [0x2034]={c='po'},
81 [0x2035]={c='po'},
82 [0x2036]={c='po'},
83 [0x2037]={c='po'},
84 [0x2039]={c='qu'},
85 [0x203A]={c='qu'},
86 [0x203C]={c='ns'},
87 [0x203D]={c='ns'},
88 [0x2044]={c='is'},
89 [0x2045]={c='op'},
90 [0x2046]={c='cl'},
91 [0x2047]={c='ns'},
92 [0x2048]={c='ns'},
93 [0x2049]={c='ns'},
94 [0x207D]={c='op'},
95 [0x207E]={c='cl'},
96 [0x208D]={c='op'},
97 [0x208E]={c='cl'},
98 [0x20A7]={c='po'},
99 [0x20B6]={c='po'},
100 [0x20BB]={c='po'},
101 [0x20BE]={c='po'},
102 [0x2103]={c='po'},
103 [0x2109]={c='po'},
104 [0x2116]={c='pr'},
105 [0x2212]={c='pr'},
106 [0x2213]={c='pr'},
107 [0x22EF]={c='in'},
108 [0x2308]={c='op'},
109 [0x2309]={c='cl'},
110 [0x230A]={c='op'},
111 [0x230B]={c='cl'},
112 [0x2329]={c='op'},
113 [0x232A]={c='cl'},
114 [0x2983]={c='op'},
115 [0x2984]={c='cl'},
116 [0x2985]={c='op'},
117 [0x2986]={c='cl'},
118 [0x2987]={c='op'},
119 [0x2988]={c='cl'},
120 [0x2989]={c='op'},
121 [0x298A]={c='cl'},
122 [0x298B]={c='op'},
123 [0x298C]={c='cl'},
124 [0x298D]={c='op'},
125 [0x298E]={c='cl'},
126 [0x298F]={c='op'},
127 [0x2990]={c='cl'},
128 [0x2991]={c='op'},
129 [0x2992]={c='cl'},
130 [0x2993]={c='op'},
131 [0x2994]={c='cl'},
132 [0x2995]={c='op'},
133 [0x2996]={c='cl'},
134 [0x2997]={c='op'},
135 [0x2998]={c='cl'},
136 [0x29D8]={c='op'},
137 [0x29D9]={c='cl'},
138 [0x29DA]={c='op'},
139 [0x29DB]={c='cl'},
140 [0x29FC]={c='op'},
141 [0x29FD]={c='cl'},
142 [0x2CF9]={c='ex'},
143 [0x2CFE]={c='ex'},
144 [0x2E02]={c='qu'},
145 [0x2E03]={c='qu'},
146 [0x2E04]={c='qu'},
147 [0x2E05]={c='qu'},
148 [0x2E06]={c='qu'},
149 [0x2E07]={c='qu'},
150 [0x2E08]={c='qu'},
151 [0x2E09]={c='qu'},
152 [0x2E0A]={c='qu'},
153 [0x2E0B]={c='qu'},
154 [0x2E0C]={c='qu'},
155 [0x2E0D]={c='qu'},
156 [0x2E18]={c='op'},
157 [0x2E1C]={c='qu'},
158 [0x2E1D]={c='qu'},
159 [0x2E20]={c='qu'},
160 [0x2E21]={c='qu'},
161 [0x2E22]={c='op'},
162 [0x2E23]={c='cl'},
163 [0x2E24]={c='op'},
164 [0x2E25]={c='cl'},
165 [0x2E26]={c='op'},
166 [0x2E27]={c='cl'},
167 [0x2E28]={c='op'},
168 [0x2E29]={c='cl'},
169 [0x2E2E]={c='ex'},
170 [0x2E42]={c='op'},
171 [0x3001]={c='cl'},
172 [0x3002]={c='cl'},
173 [0x3005]={c='ns'},
174 [0x3008]={c='op'},
175 [0x3009]={c='cl'},
176 [0x300A]={c='op'},
177 [0x300B]={c='cl'},
178 [0x300C]={c='op'},
179 [0x300D]={c='cl'},
180 [0x300E]={c='op'},
181 [0x300F]={c='cl'},
182 [0x3010]={c='op'},
183 [0x3011]={c='cl'},
184 [0x3014]={c='op'},
185 [0x3015]={c='cl'},
186 [0x3016]={c='op'},
187 [0x3017]={c='cl'},
188 [0x3018]={c='op'},
189 [0x3019]={c='cl'},
190 [0x301A]={c='op'},
191 [0x301B]={c='cl'},
192 [0x301C]={c='ns'},
193 [0x301D]={c='op'},
194 [0x301E]={c='cl'},
195 [0x301F]={c='cl'},
196 [0x3043]={c='cj'},
197 [0x3045]={c='cj'},
198 [0x3047]={c='cj'},
199 [0x3049]={c='cj'},
200 [0x3063]={c='cj'},
201 [0x3083]={c='cj'},
202 [0x3085]={c='cj'},
203 [0x3087]={c='cj'},
204 [0x308E]={c='cj'},
205 [0x3095]={c='cj'},
206 [0x3096]={c='cj'},
207 [0x303B]={c='ns'},
208 [0x303C]={c='ns'},
209 [0x3041]={c='cj'},
210 [0x309B]={c='ns'},
211 [0x309C]={c='ns'},
212 [0x309D]={c='ns'},
213 [0x309E]={c='ns'},
214 [0x30A0]={c='ns'},
215 [0x30A1]={c='cj'},
216 [0x30A3]={c='cj'},
217 [0x30A5]={c='cj'},
218 [0x30A7]={c='cj'},
219 [0x30A9]={c='cj'},
220 [0x30C3]={c='cj'},
221 [0x30E3]={c='cj'},
222 [0x30E5]={c='cj'},
223 [0x30E7]={c='cj'},
224 [0x30EE]={c='cj'},
225 [0x30F5]={c='cj'},
226 [0x30F6]={c='cj'},
227 [0x30FB]={c='ns'},
228 [0x30FC]={c='cj'},
229 [0x30FD]={c='ns'},
230 [0x30FE]={c='ns'},
231 [0xA015]={c='ns'},
232 [0xA60E]={c='ex'},
233 [0xA838]={c='po'},
234 [0xFD3E]={c='cl'},
235 [0xFD3F]={c='op'},
236 [0xFDFC]={c='po'},
237 [0xFE10]={c='is'},
238 [0xFE11]={c='cl'},
239 [0xFE12]={c='cl'},
240 [0xFE13]={c='is'},
241 [0xFE14]={c='is'},
242 [0xFE15]={c='ex'},
243 [0xFE16]={c='ex'},
244 [0xFE17]={c='op'},
245 [0xFE18]={c='cl'},
246 [0xFE19]={c='in'},
247 [0xFE35]={c='op'},
248 [0xFE36]={c='cl'},
249 [0xFE37]={c='op'},
250 [0xFE38]={c='cl'},
251 [0xFE39]={c='op'},
252 [0xFE3A]={c='cl'},
253 [0xFE3B]={c='op'},
254 [0xFE3C]={c='cl'},
255 [0xFE3D]={c='op'},
256 [0xFE3E]={c='cl'},
257 [0xFE3F]={c='op'},
258 [0xFE40]={c='cl'},
259 [0xFE41]={c='op'},
260 [0xFE42]={c='cl'},
261 [0xFE43]={c='op'},
262 [0xFE44]={c='cl'},
263 [0xFE47]={c='op'},
264 [0xFE48]={c='cl'},
265 [0xFE50]={c='cl'},
266 [0xFE52]={c='cl'},
267 [0xFE54]={c='ns'},
268 [0xFE55]={c='ns'},
269 [0xFE56]={c='ex'},
270 [0xFE57]={c='ex'},
271 [0xFE59]={c='op'},
272 [0xFE5A]={c='cl'},
273 [0xFE5B]={c='op'},
274 [0xFE5C]={c='cl'},
275 [0xFE5D]={c='op'},
276 [0xFE5E]={c='cl'},
277 [0xFE69]={c='pr'},
278 [0xFE6A]={c='po'},
279 [0xFF01]={c='ex', w='f'},
280 [0xFF04]={c='pr', w='f'},
281 [0xFF05]={c='po', w='f'},
282 [0xFF08]={c='op', w='f'},
283 [0xFF09]={c='cl', w='f'},
284 [0xFF0C]={c='cl', w='f'},
285 [0xFF0E]={c='cl', w='f'},
286 [0xFF1A]={c='ns', w='f'},
287 [0xFF1B]={c='ns', w='f'},
288 [0xFF1F]={c='ex', w='f'},
289 [0xFF3B]={c='op', w='f'},
290 [0xFF3D]={c='cl', w='f'},
291 [0xFF5B]={c='op', w='f'},
292 [0xFF5D]={c='cl', w='f'},
293 [0xFF5F]={c='op', w='f'},
294 [0xFF60]={c='cl', w='f'},
295 [0xFF61]={c='cl', w='h'},
296 [0xFF62]={c='op', w='h'},
297 [0xFF63]={c='cl', w='h'},
298 [0xFF64]={c='cl', w='h'},
299 [0xFF70]={c='cj'}
300 }
301
302 Babel.cjk_class = setmetatable ( Babel.cjk_characters, {
303 __index = function(_, k)
304 if (k >= 0xAC00 and k <= 0xD7A3) -- H2/H3
305 or (k >= 0x2E80 and k <= 0x31E9) -- Skip small
306 or (k >= 0x3200 and k <= 0x9FFF)
307 or (k >= 0xA000 and k <= 0xA48F) -- Yi
308 or (k >= 0xA490 and k <= 0xA4CF) -- Yi
309 or (k >= 0xF900 and k <= 0xFAFF)
310 or (k >= 0xFE10 and k <= 0xFE1F)
311 or (k >= 0xFE30 and k <= 0xFE6F)
312 or (k >= 0xFF00 and k <= 0xFF66) -- Skip small
313 or (k >= 0xFF70 and k <= 0xFFEF)
314 or (k >= 0x1F000 and k <= 0x1FFFD)
315 or (k >= 0x20000 and k <= 0x2FFFD)
316 or (k >= 0x30000 and k <= 0x3FFFD) then
317 return {c='I'}
318 elseif (k >= 0x20A0 and k <= 0x20CF) then
319 return {c='pr'}
320 elseif (k >= 0x31F0 and k <= 0x31FF)
321 or (k >= 0xFF67 and k <= 0xFF6F)
322 or (k >= 0x1B150 and k <= 0x1B152)
323 or (k >= 0x1B164 and k <= 0x1B167) then
324 return {c='cj'}
325 else
326 return {c='O'}
327 end
328 end })
329
330 -- Note ns = ex = sy = is = po = hy. Here, 'I' and 'O' are
331 -- pseudo-classes for ideographic-like (id, h2, h3), and 'other',
332 -- respectively. Jamo is not considered yet, but very likely at least
333 -- jl must be.
334
335 Babel.cjk_breaks = {
336 ['op'] = { },
337 ['cl'] = { ['op']=1, ['pr']=1, ['in']=1, ['I']=1 },
338 ['ns'] = { ['op']=1, ['pr']=1, ['po']=1, ['in']=1, ['I']=1 },
339 ['ex'] = { ['op']=1, ['pr']=1, ['po']=1, ['in']=1, ['I']=1 },
340 ['sy'] = { ['op']=1, ['pr']=1, ['po']=1, ['in']=1, ['I']=1 },
341 ['is'] = { ['op']=1, ['pr']=1, ['po']=1, ['in']=1, ['I']=1 },
342 ['pr'] = { ['pr']=1, ['po']=1, ['in']=1 },
343 ['po'] = { ['op']=1, ['pr']=1, ['po']=1, ['in']=1, ['I']=1 },
344 ['in'] = { ['op']=1, ['pr']=1, ['po']=1, ['I']=1 },
345 ['hy'] = { ['op']=1, ['pr']=1, ['po']=1, ['in']=1, ['I']=1 },
346 ['qu'] = { },
347 --
348 ['I'] = { ['op']=1, ['pr']=1, ['I']=1, ['O']=1 },
349 ['O'] = { ['I']=1 }
350 }