|
50 | 50 | - T: "#" # signal end of previous numeric mode |
51 | 51 | - x: "*[1]" |
52 | 52 | - test: |
53 | | - if: "$Vietnam_UseDropNumbers='true'" |
| 53 | + if: "$Vietnam_UseDropNumbers" |
54 | 54 | then: |
55 | | - - x: "BrailleChars(translate(*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'UEB')" # drop numbers for the denominator |
| 55 | + - x: "BrailleChars(translate(*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Vietnam')" # drop numbers for the denominator |
56 | 56 | else: |
57 | 57 | - T: "N⠌" |
58 | 58 | - x: "*[2]" |
|
65 | 65 | - T: "#" # signal end of any previous numeric mode (probably not needed, but...) |
66 | 66 | - x: "*[1]" |
67 | 67 | - test: |
68 | | - if: "$Vietnam_UseDropNumbers='true'" |
| 68 | + if: "$Vietnam_UseDropNumbers" |
69 | 69 | then: |
70 | | - - x: "BrailleChars(translate(*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'UEB')" # drop numbers for the denominator |
| 70 | + - x: "BrailleChars(translate(*[2], '0123456789', '\ue000\ue001\ue002\ue003\ue004\ue005\ue006\ue007\ue008\ue009'), 'Vietnam')" # drop numbers for the denominator |
71 | 71 | else: |
72 | 72 | - T: "N⠌" |
73 | 73 | - x: "*[2]" |
|
105 | 105 | - x: "*[2]/*[2]/*[1]/*[1]" |
106 | 106 | - x: "*[3]" |
107 | 107 |
|
108 | | - |
109 | 108 | # |
110 | 109 | # Matrix/Determinant rules |
111 | 110 | # matrix and determinant are the same other than "matrix"/"determinant" based on the bracketing chars |
|
120 | 119 | - "*[2][self::m:mtable] and" |
121 | 120 | - (IsBracketed(., '(', ')') or IsBracketed(., '[', ']') or IsBracketed(., '|', '|')) |
122 | 121 | replace: [x: "*[2]"] |
| 122 | +- |
| 123 | + name: default-cases |
| 124 | + tag: mrow |
| 125 | + variables: |
| 126 | + - RowStart: "*[1]" |
| 127 | + - RowEnd: "''" |
| 128 | + match: "*[2][self::m:mtable] and count(*)=2 and *[1][.='{' or .='[' or .='(']" |
| 129 | + replace: [x: "*[2]"] |
123 | 130 | - |
124 | 131 | name: default-mtable |
125 | 132 | tag: mtable |
|
130 | 137 | tag: [mtr, mlabeledtr] |
131 | 138 | match: "." |
132 | 139 | replace: |
| 140 | + - test: |
| 141 | + if: "preceding-sibling::*" |
| 142 | + then: [t: "⣍"] |
133 | 143 | - test: |
134 | 144 | if: "count(parent::*) > 1" |
135 | 145 | then: [t: "⠠"] |
|
163 | 173 | # else nothing to braille |
164 | 174 |
|
165 | 175 | - |
166 | | - name: no-content |
167 | | - tag: math |
168 | | - match: "not(*)" # empty |
169 | | - replace: [t: "W"] # not sure that is right, but this shouldn't happen |
| 176 | + name: no-content |
| 177 | + tag: math |
| 178 | + match: "not(*)" # empty |
| 179 | + replace: [t: "W"] # not sure that is right, but this shouldn't happen |
170 | 180 |
|
171 | 181 | - |
172 | | - name: default |
173 | | - tag: math |
174 | | - match: "." |
175 | | - variables: |
176 | | - - RowStart: "''" # empty string -- it needs to be set |
177 | | - - RowEnd: "''" # empty string -- it needs to be set |
178 | | - - NewScriptContext: "''" # empty string -- it needs to be set |
179 | | - replace: [x: "*"] |
| 182 | + name: default |
| 183 | + tag: math |
| 184 | + match: "." |
| 185 | + variables: |
| 186 | + - RowStart: "''" # empty string -- it needs to be set |
| 187 | + - RowEnd: "''" # empty string -- it needs to be set |
| 188 | + - NewScriptContext: "''" # empty string -- it needs to be set |
| 189 | + replace: [x: "*"] |
180 | 190 |
|
181 | 191 | - |
182 | | - name: empty-mrow |
183 | | - tag: mrow |
184 | | - match: "not(*)" |
185 | | - replace: [t: "W"] # not sure what is correct -- if in a fraction, probably something is better than nothing |
| 192 | + name: empty-mrow |
| 193 | + tag: mrow |
| 194 | + match: "not(*)" |
| 195 | + replace: [t: "W"] # not sure what is correct -- if in a fraction, probably something is better than nothing |
186 | 196 |
|
187 | 197 | - |
188 | | - name: default |
189 | | - tag: mrow |
190 | | - match: "." |
191 | | - replace: [x: "*"] |
| 198 | + name: default |
| 199 | + tag: mrow |
| 200 | + match: "." |
| 201 | + replace: [x: "*"] |
192 | 202 |
|
193 | 203 | - |
194 | 204 | # add space after these ops when they are prefix operators |
|
238 | 248 | - test: |
239 | 249 | if: "substring(., string-length(.), 1)='\u00A0'" |
240 | 250 | then: |
241 | | - - x: "BrailleChars(., 'UEB', 2, string-length(.))" |
| 251 | + - x: "BrailleChars(., 'Vietnam', 2, string-length(.))" |
242 | 252 | - test: |
243 | 253 | if: following-sibling::*[2][@class='MathML-unit' or BaseNode(.)[@class='MathML-unit']] # '*[2]' to skip invisible times |
244 | 254 | then: [t: "𝐖"] # BANA 5(a) -- Units are treated as separate exprs |
245 | 255 | else: [t: ""] |
246 | 256 | else: |
247 | | - - x: "BrailleChars(., 'UEB', 2, string-length(.)+1)" |
| 257 | + - x: "BrailleChars(., 'Vietnam', 2, string-length(.)+1)" |
248 | 258 | else: |
249 | 259 | - test: |
250 | 260 | if: "substring(., string-length(.), 1)='\u00A0'" |
251 | 261 | then: |
252 | | - - x: "BrailleChars(., 'UEB', 1, string-length(.))" |
| 262 | + - x: "BrailleChars(., 'Vietnam', 1, string-length(.))" |
253 | 263 | - test: |
254 | 264 | if: following-sibling::*[2][@class='MathML-unit' or BaseNode(.)[@class='MathML-unit']] # '*[2]' to skip invisible times |
255 | 265 | then: [t: "𝐖"] # BANA 5(a) -- Units are treated as separate exprs |
256 | 266 | else: [t: ""] |
257 | 267 | else: |
258 | | - - x: "BrailleChars(., 'UEB', 1, string-length(.)+1)" |
| 268 | + - x: "BrailleChars(., 'Vietnam', 1, string-length(.)+1)" |
259 | 269 |
|
260 | 270 | - |
261 | | - name: default |
262 | | - tag: mn |
263 | | - match: "." |
264 | | - replace: |
265 | | - - x: "BrailleChars(., 'UEB')" |
| 271 | + name: default |
| 272 | + tag: mn |
| 273 | + match: "." |
| 274 | + replace: |
| 275 | + - x: "BrailleChars(., 'Vietnam')" |
266 | 276 |
|
267 | 277 | - |
268 | | - name: sin |
269 | | - tag: mi |
270 | | - match: "text()='sin'" |
271 | | - replace: |
272 | | - - t: "⠻⠎" |
| 278 | + name: sin |
| 279 | + tag: mi |
| 280 | + match: "text()='sin'" |
| 281 | + replace: |
| 282 | + - t: "⠻⠎" |
273 | 283 |
|
274 | 284 | - |
275 | | - name: cos |
276 | | - tag: mi |
277 | | - match: "text()='cos'" |
278 | | - replace: |
279 | | - - t: "⠻⠉" |
| 285 | + name: cos |
| 286 | + tag: mi |
| 287 | + match: "text()='cos'" |
| 288 | + replace: |
| 289 | + - t: "⠻⠉" |
280 | 290 |
|
281 | 291 | - |
282 | | - name: tan |
283 | | - tag: mi |
284 | | - match: "text()='tan'" |
285 | | - replace: |
286 | | - - t: "⠻⠞" |
| 292 | + name: tan |
| 293 | + tag: mi |
| 294 | + match: "text()='tan'" |
| 295 | + replace: |
| 296 | + - t: "⠻⠞" |
287 | 297 |
|
288 | 298 | - |
289 | | - name: cot |
290 | | - tag: mi |
291 | | - match: "text()='cot'" |
292 | | - replace: |
293 | | - - t: "⠻⠉⠞" |
| 299 | + name: cot |
| 300 | + tag: mi |
| 301 | + match: "text()='cot'" |
| 302 | + replace: |
| 303 | + - t: "⠻⠉⠞" |
294 | 304 |
|
295 | 305 | - |
296 | | - name: arcsin |
297 | | - tag: mi |
298 | | - match: "text()='arcsin'" |
299 | | - replace: |
300 | | - - t: "⠁⠗⠉⠻⠎" |
| 306 | + name: arcsin |
| 307 | + tag: mi |
| 308 | + match: "text()='arcsin'" |
| 309 | + replace: |
| 310 | + - t: "⠁⠗⠉⠻⠎" |
301 | 311 |
|
302 | 312 | - |
303 | | - name: arccos |
304 | | - tag: mi |
305 | | - match: "text()='arccos'" |
306 | | - replace: |
307 | | - - t: "⠁⠗⠉⠻⠉" |
| 313 | + name: arccos |
| 314 | + tag: mi |
| 315 | + match: "text()='arccos'" |
| 316 | + replace: |
| 317 | + - t: "⠁⠗⠉⠻⠉" |
308 | 318 |
|
309 | 319 | - |
310 | | - name: arctan |
311 | | - tag: mi |
312 | | - match: "text()='arctan'" |
313 | | - replace: |
314 | | - - t: "⠁⠗⠉⠻⠞" |
| 320 | + name: arctan |
| 321 | + tag: mi |
| 322 | + match: "text()='arctan'" |
| 323 | + replace: |
| 324 | + - t: "⠁⠗⠉⠻⠞" |
315 | 325 |
|
316 | 326 | - |
317 | | - name: arccot |
318 | | - tag: mi |
319 | | - match: "text()='arccot'" |
320 | | - replace: |
321 | | - - t: "⠁⠗⠉⠻⠉⠞" |
| 327 | + name: arccot |
| 328 | + tag: mi |
| 329 | + match: "text()='arccot'" |
| 330 | + replace: |
| 331 | + - t: "⠁⠗⠉⠻⠉⠞" |
322 | 332 |
|
323 | 333 | - |
324 | | - # FIX: need to deal with all caps |
325 | | - name: default |
326 | | - tag: [mi, mtext] |
327 | | - match: "." |
328 | | - replace: |
329 | | - - x: "BrailleChars(., 'UEB')" |
| 334 | + # FIX: need to deal with all caps |
| 335 | + name: default |
| 336 | + tag: [mi, mtext] |
| 337 | + match: "." |
| 338 | + replace: |
| 339 | + - test: |
| 340 | + if: "IsInDefinition(., 'Units') or (string-length(.)=1 and @mathvariant='normal')" |
| 341 | + then: [t: "W"] |
| 342 | + - x: "BrailleChars(., 'Vietnam')" |
330 | 343 |
|
331 | 344 |
|
332 | 345 | - |
333 | | - name: default |
334 | | - tag: mstyle |
335 | | - match: "." |
336 | | - replace: |
337 | | - - test: |
| 346 | + name: default |
| 347 | + tag: mstyle |
| 348 | + match: "." |
| 349 | + replace: |
| 350 | + - test: |
338 | 351 | if: "*" |
339 | 352 | then: [x: "*"] |
340 | 353 | # else do nothing -- no content |
341 | 354 |
|
342 | 355 |
|
343 | 356 | - |
344 | | - name: angle # angles need a shape indicator -- not sure this is the best test (three letters in base, have invisible separators) |
345 | | - tag: mover |
346 | | - match: "*[2][text()='^'] and *[1][ |
347 | | - self::m:mrow and count(*)=5 and |
348 | | - *[1][self::m:mi] and *[2][text()='\u2063'] and *[3][self::m:mi] and *[4][text()='\u2063'] and *[5][self::m:mi] |
349 | | - ]" |
350 | | - replace: |
351 | | - - t: "⠫⠛" # shape indicator, g |
352 | | - - x: "*[1]" |
| 357 | + name: angle # angles need a shape indicator -- not sure this is the best test (three letters in base, have invisible separators) |
| 358 | + tag: mover |
| 359 | + match: "*[2][text()='^'] and *[1][ |
| 360 | + self::m:mrow and count(*)=5 and |
| 361 | + *[1][self::m:mi] and *[2][text()='\u2063'] and *[3][self::m:mi] and *[4][text()='\u2063'] and *[5][self::m:mi] |
| 362 | + ]" |
| 363 | + replace: |
| 364 | + - t: "⠫⠛" # shape indicator, g |
| 365 | + - x: "*[1]" |
353 | 366 |
|
354 | 367 | - |
355 | 368 | name: single-char-exceptions # GTM 12 |
|
380 | 393 | then: [t: "⠠"] |
381 | 394 | - test: |
382 | 395 | - if: "*[2][text()='_' or text()='¯']" |
383 | | - then: [t: "⠱"] |
| 396 | + then: [T: "⠨⠱"] |
384 | 397 | - else_if: "*[2][text()='→']" |
385 | 398 | then: [T: "⠨⠔⠳⠕"] |
386 | 399 | - else_if: "*[2][text()='.' or text()='˙']" |
|
442 | 455 | - t: "⠱" |
443 | 456 | - t: "#" # signal end script/numeric mode |
444 | 457 |
|
| 458 | +- name: log-base-power |
| 459 | + tag: msubsup |
| 460 | + match: "*[1][.='log']" |
| 461 | + replace: |
| 462 | + - x: "*[1]" # log |
| 463 | + - T: "⠔" |
| 464 | + - x: "*[3]" # superscript |
| 465 | + - T: "⠢" |
| 466 | + - x: "*[2]" # supscript |
445 | 467 |
|
446 | 468 | - |
447 | 469 | name: msubsup_default_mmultiscripts_equiv |
|
466 | 488 | replace: |
467 | 489 | - test: |
468 | 490 | - if: "self::m:munderover" |
469 | | - then: [t: "⠨⠢"] |
| 491 | + then: [t: "⠢"] # not use dots 46-26, just use same sub sign dots 26 |
470 | 492 | else: [t: "⠢"] |
471 | 493 | - test: |
472 | 494 | # omit grouping indicators in the following cases |
|
486 | 508 | - t: "⠜" |
487 | 509 | - test: |
488 | 510 | - if: "self::m:munderover" |
489 | | - then: [t: "⠨⠔"] |
| 511 | + then: [t: "⠔"] # not use ⠨⠔ as UEB, just use dots 35 |
490 | 512 | else: [t: "⠔"] |
491 | 513 | - test: |
492 | 514 | # omit grouping indicators in the following cases |
|
963 | 985 | then: [t: "⠳⠺⠗⠣"] |
964 | 986 | - test: |
965 | 987 | if: "contains(@notation,'top')" |
966 | | - then: [t: "⠱"] |
| 988 | + then: [T: "⠨⠱"] |
967 | 989 | - test: |
968 | 990 | if: "contains(@notation,'bottom')" |
969 | 991 | then: [t: "⠠⠱"] |
|
996 | 1018 | if: "string(@lquote)!=''" |
997 | 1019 | then: [x: "@lquote"] |
998 | 1020 | else: [t: "⠄⠄"] |
999 | | - - x: "BrailleChars(., 'UEB')" |
| 1021 | + - x: "BrailleChars(., 'Vietnam')" |
1000 | 1022 | - test: |
1001 | 1023 | if: "string(@rquote)!=''" |
1002 | 1024 | then: [x: "@rquote"] |
|
0 commit comments