Debian Codegraph @

tests/yaml/inpos_outpos.yaml

raw symbols SCIP
1 # Simple replacement with context
2 table: |
3 include tables/unicode-without-blank.dis
4 include tables/latinLetterDef8Dots.uti
5 punctuation - 36
6 noback context "oo"["b"] @36-12
7 nofor context @135-135[@36-12] "b"
8
9 flags: {testmode: bothDirections}
10 tests:
11 # - |f|o|o|b|a|r|
12 # - |⠋|⠕|⠕|⠤⠃|⠁|⠗|
13 - - foobar
14 - ⠋⠕⠕⠤⠃⠁⠗
15 - outputPos: [0,1,2,3,5,6]
16 inputPos: [0,1,2,3,3,4,5]
17
18 table: |
19 include tables/unicode-without-blank.dis
20 include tables/latinLetterDef8Dots.uti
21 include tables/loweredDigits6Dots.uti
22 space \s 0
23 punctuation . 46
24 punctuation , 6
25 punctuation - 36
26 include tables/braille-patterns.cti
27 noback correct "f,"[]"o" "-"
28 nofor correct "f,"["-"]"o" ?
29 noback correct "f,"["."]"o" ?
30 nofor correct "f,"[]"o" "."
31 word above 1-12-1236
32 word below 23-123
33 partword en 26
34 noback context "o,"[]"o" @36
35 nofor context @135-6[@36]@135 ?
36 noback context "o,"["."]"o" ?
37 nofor context @135-6[]@135 "."
38 noback pass2 @135-6[]@12 @36
39 nofor pass2 @135-6[@36]@12 ?
40 noback pass2 @135-6[@46]@12 ?
41 nofor pass2 @135-6[]@12 @46
42 noback pass3 @12-6[]@1 @36
43 nofor pass3 @12-6[@36]@1 ?
44 noback pass3 @12-6[@46]@1 ?
45 nofor pass3 @12-6[]@1 @46
46 noback pass4 @1-6[]@1235 @36
47 nofor pass4 @1-6[@36]@1235 ?
48 noback pass4 @1-6[@46]@1235 ?
49 nofor pass4 @1-6[]@1235 @46
50
51 # Simple test using regular pass 1 rules
52 flags: {testmode: bothDirections}
53 tests:
54 # - |h|e| |w|en|t| |above|
55 # - |⠓|⠑| |⠺|⠢|⠞| |⠁⠃⠧|
56 - - he went above
57 - ⠓⠑ ⠺⠢⠞ ⠁⠃⠧
58 - inputPos: [0,1,2,3,4,6,7,8,8,8]
59 outputPos: [0,1,2,3,4,4,5,6,7,7,7,7,7]
60
61 # Insertion with correct rule: prepend to next
62 flags: {testmode: bothDirections}
63 tests:
64 # - |f|,|o|o|b|a|r|
65 # - |⠋|⠠|⠤⠕|⠕|⠃|⠁|⠗|
66 - - f,oobar
67 - ⠋⠠⠤⠕⠕⠃⠁⠗
68 - inputPos: [0,1,2,2,3,4,5,6]
69 outputPos: [0,1,2,4,5,6,7]
70
71 # Deletion with correct rule: append to previous
72 flags: {testmode: bothDirections}
73 tests:
74 # - |f|,.|o|o|b|a|r|
75 # - |⠋|⠠|⠕|⠕|⠃|⠁|⠗|
76 - - f,.oobar
77 - ⠋⠠⠕⠕⠃⠁⠗
78 - inputPos: [0,1,3,4,5,6,7]
79 outputPos: [0,1,1,2,3,4,5,6]
80
81 # Insertion with context rule: prepend to next
82 flags: {testmode: bothDirections}
83 tests:
84 # - |f|o|,|o|b|a|r|
85 # - |⠋|⠕|⠠|⠤⠕|⠃|⠁|⠗|
86 - - fo,obar
87 - ⠋⠕⠠⠤⠕⠃⠁⠗
88 - inputPos: [0,1,2,3,3,4,5,6]
89 outputPos: [0,1,2,3,5,6,7]
90
91 # Deletion with context rule: append to previous
92 flags: {testmode: bothDirections}
93 tests:
94 # - |f|o|,.|o|b|a|r|
95 # - |⠋|⠕|⠠|⠕|⠃|⠁|⠗|
96 - - fo,.obar
97 - ⠋⠕⠠⠕⠃⠁⠗
98 - inputPos: [0,1,2,4,5,6,7]
99 outputPos: [0,1,2,2,3,4,5,6]
100
101 # Insertion with pass2 rule: prepend to next
102 flags: {testmode: bothDirections}
103 tests:
104 # - |f|o|o|,|b|a|r|
105 # - |⠋|⠕|⠕|⠠|⠤⠃|⠁|⠗|
106 - - foo,bar
107 - ⠋⠕⠕⠠⠤⠃⠁⠗
108 - inputPos: [0,1,2,3,4,4,5,6]
109 outputPos: [0,1,2,3,4,6,7]
110
111 # Deletion with pass2 rule: append to previous
112 flags: {testmode: bothDirections}
113 tests:
114 # - |f|o|o|,.|b|a|r
115 # - |⠋|⠕|⠕|⠠|⠃|⠁|⠗|
116 - - foo,.bar
117 - ⠋⠕⠕⠠⠃⠁⠗
118 - inputPos: [0,1,2,3,5,6,7]
119 outputPos: [0,1,2,3,3,4,5,6]
120
121 # Insertion with pass3 rule: prepend to next
122 flags: {testmode: bothDirections}
123 tests:
124 # - |f|o|o|b|,|a|r|
125 # - |⠋|⠕|⠕|⠃|⠠|⠤⠁|⠗|
126 - - foob,ar
127 - ⠋⠕⠕⠃⠠⠤⠁⠗
128 - inputPos: [0,1,2,3,4,5,5,6]
129 outputPos: [0,1,2,3,4,5,7]
130
131 # Deletion with pass3 rule: append to previous
132 flags: {testmode: bothDirections}
133 tests:
134 # - |f|o|o|b|,.|a|r|
135 # - |⠋|⠕|⠕|⠃|⠠|⠁|⠗|
136 - - foob,.ar
137 - ⠋⠕⠕⠃⠠⠁⠗
138 - inputPos: [0,1,2,3,4,6,7]
139 outputPos: [0,1,2,3,4,4,5,6]
140
141 # Insertion with pass4 rule: prepend to next
142 flags: {testmode: bothDirections}
143 tests:
144 # - |f|o|o|b|a|,|r|
145 # - |⠋|⠕|⠕|⠃|⠁|⠠|⠤⠗|
146 - - fooba,r
147 - ⠋⠕⠕⠃⠁⠠⠤⠗
148 - inputPos: [0,1,2,3,4,5,6,6]
149 outputPos: [0,1,2,3,4,5,6]
150
151 # Deletion with pass4 rule: append to previous
152 flags: {testmode: bothDirections}
153 tests:
154 # - |f|o|o|b|a|,.|r|
155 # - |⠋|⠕|⠕|⠃|⠁|⠠|⠗|
156 - - fooba,.r
157 - ⠋⠕⠕⠃⠁⠠⠗
158 - inputPos: [0,1,2,3,4,5,7]
159 outputPos: [0,1,2,3,4,5,5,6]
160
161 # Using all passes!
162 flags: {testmode: bothDirections}
163 tests:
164 # - |f|,|o|,|o|,|b|,|a|,|r|
165 # - |⠋|⠠|⠤⠕|⠠|⠤⠕|⠠|⠤⠃|⠠|⠤⠁|⠠|⠤⠗|
166 - - f,o,o,b,a,r
167 - ⠋⠠⠤⠕⠠⠤⠕⠠⠤⠃⠠⠤⠁⠠⠤⠗
168 - inputPos: [0,1,2,2,3,4,4,5,6,6,7,8,8,9,10,10]
169 outputPos: [0,1,2,4,5,7,8,10,11,13,14]
170 # - |f|,.|o|,.|o|,.|b|,.|a|,.|r|
171 # - |⠋|⠠|⠕|⠠|⠕|⠠|⠃|⠠|⠁|⠠|⠗|
172 - - f,.o,.o,.b,.a,.r
173 - ⠋⠠⠕⠠⠕⠠⠃⠠⠁⠠⠗
174 - inputPos: [0,1,3,4,6,7,9,10,12,13,15]
175 outputPos: [0,1,1,2,3,3,4,5,5,6,7,7,8,9,9,10]
176
177 # Insertion at the start of a string: prepend to next
178 table: |
179 include tables/latinLetterDef6Dots.uti
180 sign . 123456
181 # noback correct `[]$a "." # "true" insertion not possible
182 noback correct `[$a] "."*
183 nofor correct `[$a] ?
184 flags: {testmode: bothDirections}
185 tests:
186 # - |f|o|o|b|a|r|
187 # - |.f|o|o|b|a|r|
188 - - foobar
189 - .foobar
190 - inputPos: [0,0,1,2,3,4,5]
191 outputPos: [0,2,3,4,5,6]
192
193 # Insertion at the end of a string: append to previous
194 table: |
195 include tables/latinLetterDef6Dots.uti
196 sign . 123456
197 noback correct $a[]~ "." # "true" insertion
198 nofor correct [$a]~ ?
199 table: |
200 include tables/latinLetterDef6Dots.uti
201 sign . 123456
202 noback correct [$a]~ *"."
203 nofor correct [$a]~ ?
204 flags: {testmode: bothDirections}
205 tests:
206 # - |f|o|o|b|a|r|
207 # - |f|o|o|b|a|r.|
208 - - foobar
209 - foobar.
210 - inputPos: [0,1,2,3,4,5,5]
211 outputPos: [0,1,2,3,4,5]
212
213 # Deletion at the start of a string: append to previous from pov of output (braille), prepend to next from pov of input
214 table: |
215 include tables/latinLetterDef6Dots.uti
216 noback correct `[$a] ?
217 # nofor correct `[]$a "f" # "true" insertion not possible
218 nofor correct `[$a] "f"*
219 flags: {testmode: bothDirections}
220 tests:
221 # - f|o|o|b|a|r|
222 # - |o|o|b|a|r|
223 - - foobar
224 - oobar
225 - inputPos: [1,2,3,4,5]
226 outputPos: [0,0,1,2,3,4]
227
228 # Deletion at the end of a string: append to previous
229 table: |
230 include tables/latinLetterDef6Dots.uti
231 noback correct [$a]~ ?
232 nofor correct $a[]~ "r" # "true" insertion
233 table: |
234 include tables/latinLetterDef6Dots.uti
235 noback correct [$a]~ ?
236 nofor correct [$a]~ *"r"
237 flags: {testmode: bothDirections}
238 tests:
239 # - |f|o|o|b|ar|
240 # - |f|o|o|b|a|
241 - - foobar
242 - fooba
243 - inputPos: [0,1,2,3,4]
244 outputPos: [0,1,2,3,4,4]
245
246 # Deletion of all characters: append to (missing) previous
247 table: |
248 include tables/latinLetterDef6Dots.uti
249 noback correct [$a]~ ?
250 flags: {testmode: forward}
251 tests:
252 # - |f|
253 # - ||
254 - - f
255 - ""
256 - inputPos: []
257 outputPos: [-1]
258
259 # Deletion with replace rule: append to previous
260 table: |
261 include tables/unicode-without-blank.dis
262 include tables/latinLetterDef8Dots.uti
263 punctuation . 46
264 punctuation , 6
265 replace .
266 flags: {testmode: forward}
267 tests:
268 # - |f|,.|o|o|b|a|r|
269 # - |⠋|⠠|⠕|⠕|⠃|⠁|⠗|
270 - - f,.oobar
271 - ⠋⠠⠕⠕⠃⠁⠗
272 - inputPos: [0,1,3,4,5,6,7]
273 outputPos: [0,1,1,2,3,4,5,6]
274
275 # Deletion of undefined character: append to previous
276 table: |
277 include tables/unicode-without-blank.dis
278 include tables/latinLetterDef8Dots.uti
279 punctuation , 6
280 flags: {testmode: forward}
281 tests:
282 # - |f|,.|o|o|b|a|r|
283 # - |⠋|⠠|⠕|⠕|⠃|⠁|⠗|
284 - - f,.oobar
285 - ⠋⠠⠕⠕⠃⠁⠗
286 - inputPos: [0,1,3,4,5,6,7]
287 outputPos: [0,1,1,2,3,4,5,6]
288 mode: [noUndefined]
289
290 # Deletion of undefined dots: prepend to next
291 table: |
292 include tables/unicode-without-blank.dis
293 include tables/latinLetterDef8Dots.uti
294 punctuation , 6
295 flags: {testmode: backward}
296 tests:
297 # - |⠋|⠠|⠤⠕|⠕|⠃|⠁|⠗|
298 # - |f|,|o|o|b|a|r|
299 - - ⠋⠠⠤⠕⠕⠃⠁⠗
300 - f,oobar
301 - inputPos: [0,1,2,4,5,6,7]
302 outputPos: [0,1,2,2,3,4,5,6]
303 mode: [noUndefined]
304
305 # =============================================
306
307
308 # Converted from inpos.c
309 # input aaabcd ef g
310 # 012345 67 8
311 # pass0 a bcddef g
312 # 0 345567 8
313 # pass1 x cddw g
314 # 0 4556 8
315 # pass2 zy dw g
316 # 00 56 8
317 # pass3 zy deeeg
318 # 00 56668
319
320 table: |
321 sign a 1
322 sign b 2
323 sign c 3
324 sign d 4
325 sign e 5
326 sign f 6
327 sign g 7
328 sign w 13
329 sign x 12
330 sign y 34
331 sign z 56
332 noback correct ["aaa"] "a"
333 noback correct ["d"] "dd"
334 tests:
335 - - aaabcdefg
336 - abcddefg
337 - inputPos: [0,3,4,5,5,6,7,8]
338
339 table: |
340 sign a 1
341 sign b 2
342 sign c 3
343 sign d 4
344 sign e 5
345 sign f 6
346 sign g 7
347 sign w 13
348 sign x 12
349 sign y 34
350 sign z 56
351 noback correct ["aaa"] "a"
352 noback correct ["d"] "dd"
353 noback context ["ab"] @12
354 always ef 13
355 tests:
356 - - aaabcdefg
357 - xcddwg
358 - inputPos: [0,4,5,5,6,8]
359
360 table: |
361 sign a 1
362 sign b 2
363 sign c 3
364 sign d 4
365 sign e 5
366 sign f 6
367 sign g 7
368 sign w 13
369 sign x 12
370 sign y 34
371 sign z 56
372 noback correct ["aaa"] "a"
373 noback correct ["d"] "dd"
374 noback context ["ab"] @12
375 always ef 13
376 noback pass2 @12-3-4 @56-34
377 tests:
378 - - aaabcdefg
379 - zydwg
380 - inputPos: [0,0,5,6,8]
381
382 table: |
383 sign a 1
384 sign b 2
385 sign c 3
386 sign d 4
387 sign e 5
388 sign f 6
389 sign g 7
390 sign w 13
391 sign x 12
392 sign y 34
393 sign z 56
394 noback correct ["aaa"] "a"
395 noback correct ["d"] "dd"
396 noback context ["ab"] @12
397 always ef 13
398 noback pass2 @12-3-4 @56-34
399 noback pass3 [@13] @5-5-5
400 tests:
401 - - aaabcdefg
402 - zydeeeg
403 - inputPos: [0,0,5,6,6,6,8]
404
405 # Converted from inpos_match_replace.c
406 table: |
407 display A 1
408 display B 12
409 display E 15
410 display F 124
411 display G 1245
412 display I 24
413 display L 123
414 display N 1345
415 display R 1235
416 display S 234
417 display U 136
418 display V 1236
419 display 7 12456
420 display - 36
421 display - 36a
422 lowercase a 1
423 lowercase b 12
424 lowercase e 15
425 lowercase f 124
426 lowercase g 1245
427 lowercase i 24
428 lowercase l 123
429 lowercase n 1345
430 lowercase r 1235
431 lowercase s 234
432 lowercase u 136
433 lowercase v 1236
434 base uppercase A a
435 base uppercase B b
436 base uppercase E e
437 base uppercase F f
438 base uppercase G g
439 base uppercase I i
440 base uppercase L l
441 base uppercase N n
442 base uppercase R r
443 base uppercase S s
444 base uppercase U u
445 base uppercase V v
446 digit \x0037 12456 7
447 punctuation \x002D 36 -
448 math \x2212 36a -
449 begword ver 36a
450 noback pass2 @36[@36a] @1236-12456
451 tests:
452 - - Fussball-Vereinigung
453 - FUSSBALL-V7EINIGUNG
454 - inputPos: [0,1,2,3,4,5,6,7,8,9,9,12,13,14,15,16,17,18,19]
455
456 # Converted from pass2_inpos.c
457 table: |
458 lowercase e 15
459 lowercase n 1345
460 lowercase r 1235
461 lowercase o 135
462 lowercase x 1346
463 base uppercase E e
464 base uppercase N n
465 base uppercase R r
466 base uppercase O o
467 base uppercase X x
468 punctuation ' 6
469 noback pass2 @135 @6-135
470 noback pass2 @1346 ?
471 tests:
472 # First check a plain word to see if inpos handling generally works
473 - - Rene
474 - rene
475 - inputPos: [0,1,2,3]
476 # then try a word which uses pass2 and makes the output longer
477 - - Reno
478 - "ren'o"
479 - inputPos: [0,1,2,3,3]
480 # Finally try a word also uses pass2, deletes a char from the
481 # output and essentially shortens the output
482 - - xRen
483 - ren
484 - inputPos: [1,2,3]