Debian Codegraph @

tests/yaml/mixed-case.yaml

raw symbols SCIP
1 # Tests for #507: mixed lower and upper case.
2
3 # we define a very simple table and just test whether the word rule
4 # matches when we encounter mixed case input. Since we do not define
5 # any caps rules we expect liblouis to ignore capitalization
6 table: |
7 include tables/de-chardefs6.cti
8 word mit 2345
9
10 tests:
11 - [mit, t]
12 - [Mit, t, {xfail: "returns 'mit' instead"}]
13 - [MIT, t]
14 - [mIt, t, {xfail: "returns 'mit' instead"}]
15 - [miT, t, {xfail: "returns 'mit' instead"}]
16
17 # same test as above basically but this time using an always rule
18 # instead of a word rule
19 table: |
20 include tables/de-chardefs6.cti
21 always mit 2345
22
23 tests:
24 - [mit, t]
25 - [Mit, t, {xfail: "returns 'mit' instead"}]
26 - [MIT, t]
27 - [mIt, t, {xfail: "returns 'mit' instead"}]
28 - [miT, t, {xfail: "returns 'mit' instead"}]
29
30 # here's another test similar to the first one just using a different
31 # input text
32 table: |
33 include tables/de-chardefs6.cti
34 word man 134
35
36 tests:
37 - [man, m]
38 - [Man, m, {xfail: "returns 'man' instead"}]
39 - [MAN, m]
40 - [maN, m, {xfail: "returns 'man' instead"}]
41 - [mAn, m, {xfail: "returns 'man' instead"}]
42
43 # when enabling capitalization using a capsletter rule everything
44 # works as expected
45 table: |
46 include tables/de-chardefs6.cti
47 always mit 2345
48 sign $ 46
49 capsletter 46
50
51 tests:
52 - [mit, t]
53 - [Mit, $t]
54 - [MIT, t]
55 - [mIt, m$it]
56 - [miT, mi$t]
57
58 # Now, let's try to add capitalization and remove it later in a pass2.
59 # This does not work. The mixed case mIt prevents contraction, so
60 # removing the capitalization doesn't help (at least no in all cases)
61 table: |
62 include tables/de-chardefs6.cti
63 always mit 2345
64 sign $ ef
65 capsletter ef
66 noback pass2 @ef ?
67
68 tests:
69 - [mit, t]
70 - [Mit, t]
71 - [MIT, t]
72 - [mIt, t, {xfail: "returns 'man' instead"}]
73 - [miT, t, {xfail: "returns 'man' instead"}]
74
75 # Finally let's try to disable capitalization by correcting the input
76 # to be all lowercase. This works.
77 table: |
78 include tables/de-chardefs6.cti
79 word mit 2345
80 swapcc toLowercase ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
81 noback correct %toLowercase %toLowercase
82
83 tests:
84 - [mit, t]
85 - [Mit, t]
86 - [MIT, t]
87 - [mIt, t]
88 - [miT, t]
89