-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·185 lines (131 loc) · 12.4 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#!/bin/bash
mkdir -p compiled images
for i in sources/*.txt tests/*.txt; do
echo "Compiling: $i"
fstcompile --isymbols=syms.txt --osymbols=syms.txt $i | fstarcsort > compiled/$(basename $i ".txt").fst
done
echo "Compiling: compiled/A2R.fst"
fstinvert compiled/R2A.fst > compiled/A2R.fst # A2R
echo "Compiling: compiled/birthR2A.fst"
fstcompose compiled/R2A.fst compiled/d2dd.fst > compiled/tmp.fst # R2A2dd
fstconcat compiled/tmp.fst compiled/copy.fst > compiled/tmp2.fst # R2A2dd copy
fstconcat compiled/tmp2.fst compiled/tmp2.fst > compiled/tmp3.fst # R2A2dd copy R2A2dd copy
fstcompose compiled/R2A.fst compiled/d2dddd.fst > compiled/tmp4.fst # R2A2dddd
fstconcat compiled/tmp3.fst compiled/tmp4.fst > compiled/birthR2A.fst # R2A2dd copy R2A2dd copy R2A2dddd
rm compiled/tmp*
echo "Compiling: compiled/birthA2T.fst"
fstconcat compiled/copy.fst compiled/copy.fst > compiled/tmp.fst # copy2
fstconcat compiled/tmp.fst compiled/copy.fst > compiled/tmp2.fst # copy3
fstconcat compiled/tmp2.fst compiled/mm2mmm.fst > compiled/tmp3.fst # copy3 mm2mmm
fstconcat compiled/tmp3.fst compiled/copy.fst > compiled/tmp4.fst # copy3 mm2mmm copy
fstconcat compiled/tmp4.fst compiled/tmp.fst > compiled/tmp5.fst # copy3 mm2mmm copy3
fstconcat compiled/tmp5.fst compiled/tmp.fst > compiled/birthA2T.fst # copy3 mm2mmm copy5
rm compiled/tmp*
echo "Compiling: compiled/birthT2R.fst"
fstinvert compiled/d2dd.fst > compiled/tmp.fst # dd2d
fstcompose compiled/tmp.fst compiled/A2R.fst > compiled/tmp2.fst # dd2d2R
fstinvert compiled/mm2mmm.fst > compiled/tmp3.fst # mmm2mm
fstcompose compiled/tmp3.fst compiled/tmp.fst > compiled/tmp4.fst # mmm2d
fstcompose compiled/tmp4.fst compiled/A2R.fst > compiled/tmp5.fst # mmm2d2R
fstinvert compiled/d2dddd.fst > compiled/tmp6.fst # dddd2d
fstcompose compiled/tmp6.fst compiled/A2R.fst > compiled/tmp7.fst # dddd2d2R
fstconcat compiled/tmp2.fst compiled/copy.fst > compiled/tmp8.fst # dd2d2R copy
fstconcat compiled/tmp5.fst compiled/copy.fst > compiled/tmp9.fst # mmm2d2R copy
fstconcat compiled/tmp8.fst compiled/tmp9.fst > compiled/tmp10.fst # dd2d2R copy mmm2R copy
fstconcat compiled/tmp10.fst compiled/tmp7.fst > compiled/birthT2R.fst # dd2d2R copy mmm2R copy dddd2d2R
rm compiled/tmp*
echo "Compiling: compiled/birthR2L.fst"
fstcompose compiled/birthR2A.fst compiled/date2year.fst > compiled/tmp.fst # date2yearA
fstcompose compiled/tmp.fst compiled/leap.fst > compiled/birthR2L.fst # date2yearAleap
rm compiled/tmp*
# TESTS
echo "Testing the transducer 'mm2mmm' with the input 'tests/mm2mmm-test.txt' (generating pdf)"
fstcompose compiled/mm2mmm-test.fst compiled/mm2mmm.fst | fstshortestpath > compiled/mm2mmm-res.fst
echo "Testing the transducer 'd2dd' with the input 'tests/d2dd-test.txt' (generating pdf)"
fstcompose compiled/d2dd-test.fst compiled/d2dd.fst | fstshortestpath > compiled/d2dd-res.fst
echo "Testing the transducer 'd2dddd' with the input 'tests/d2dddd-test.txt' (generating pdf)"
fstcompose compiled/d2dddd-test.fst compiled/d2dddd.fst | fstshortestpath > compiled/d2dddd-res.fst
echo "Testing the transducer 'copy' with the input 'tests/copy-test.txt' (generating pdf)"
fstcompose compiled/copy-test.fst compiled/copy.fst | fstshortestpath > compiled/copy-res.fst
echo "Testing the transducer 'skip' with the input 'tests/skip-test.txt' (generating pdf)"
fstcompose compiled/skip-test.fst compiled/skip.fst | fstshortestpath > compiled/skip-res.fst
echo "Testing the transducer 'date2year' with the input 'tests/date2year-test.txt' (generating pdf)"
fstcompose compiled/date2year-test.fst compiled/date2year.fst | fstshortestpath > compiled/date2year-res.fst
echo "Testing the transducer 'leap' with the input 'tests/leap-test.txt' (generating pdf)"
fstcompose compiled/leap-test.fst compiled/leap.fst | fstshortestpath > compiled/leap-res.fst
echo "Testing the transducer 'R2A' with the input 'tests/R2A-test.txt' (generating pdf)"
fstcompose compiled/R2A-test.fst compiled/R2A.fst | fstshortestpath > compiled/R2A-res.fst
echo "Testing the transducer 'A2R' with the input 'tests/A2R-test.txt' (generating pdf)"
fstcompose compiled/A2R-test.fst compiled/A2R.fst | fstshortestpath > compiled/A2R-res.fst
echo "Testing the transducer 'birthR2A' with the input 'tests/birthR2A-test.txt' (generating pdf)"
fstcompose compiled/birthR2A-test.fst compiled/birthR2A.fst | fstshortestpath > compiled/birthR2A-res.fst
echo "Testing the transducer 'birthA2T' with the input 'tests/birthA2T-test.txt' (generating pdf)"
fstcompose compiled/birthA2T-test.fst compiled/birthA2T.fst | fstshortestpath > compiled/birthA2T-res.fst
echo "Testing the transducer 'birthT2R' with the input 'tests/birthT2R-test.txt' (generating pdf)"
fstcompose compiled/birthT2R-test.fst compiled/birthT2R.fst | fstshortestpath > compiled/birthT2R-res.fst
echo "Testing the transducer 'birthR2L' with the input 'tests/birthR2L-test.txt' (generating pdf)"
fstcompose compiled/birthR2L-test.fst compiled/birthR2L.fst | fstshortestpath > compiled/birthR2L-res.fst
# birthday tests
echo "Testing the transducer 'birthR2A' with the input 'tests/92509birthR2A.txt' (generating pdf)"
fstcompose compiled/92509birthR2A.fst compiled/birthR2A.fst | fstshortestpath > compiled/92509birthR2A-res.fst
echo "Testing the transducer 'birthA2T' with the input 'tests/92509birthA2T.txt' (generating pdf)"
fstcompose compiled/92509birthA2T.fst compiled/birthA2T.fst | fstshortestpath > compiled/92509birthA2T-res.fst
echo "Testing the transducer 'birthT2R' with the input 'tests/92509birthT2R.txt' (generating pdf)"
fstcompose compiled/92509birthT2R.fst compiled/birthT2R.fst | fstshortestpath > compiled/92509birthT2R-res.fst
echo "Testing the transducer 'birthR2L' with the input 'tests/92509birthR2L.txt' (generating pdf)"
fstcompose compiled/92509birthR2L.fst compiled/birthR2L.fst | fstshortestpath > compiled/92509birthR2L-res.fst
echo "Testing the transducer 'birthR2A' with the input 'tests/90760birthR2A.txt' (generating pdf)"
fstcompose compiled/90760birthR2A.fst compiled/birthR2A.fst | fstshortestpath > compiled/90760birthR2A-res.fst
echo "Testing the transducer 'birthA2T' with the input 'tests/90760birthA2T.txt' (generating pdf)"
fstcompose compiled/90760birthA2T.fst compiled/birthA2T.fst | fstshortestpath > compiled/90760birthA2T-res.fst
echo "Testing the transducer 'birthT2R' with the input 'tests/90760birthT2R.txt' (generating pdf)"
fstcompose compiled/90760birthT2R.fst compiled/birthT2R.fst | fstshortestpath > compiled/90760birthT2R-res.fst
echo "Testing the transducer 'birthR2L' with the input 'tests/90760birthR2L.txt' (generating pdf)"
fstcompose compiled/90760birthR2L.fst compiled/birthR2L.fst | fstshortestpath > compiled/90760birthR2L-res.fst
for i in compiled/*.fst; do
echo "Creating image: images/$(basename $i '.fst').pdf"
fstdraw --portrait --isymbols=syms.txt --osymbols=syms.txt $i | dot -Tpdf > images/$(basename $i '.fst').pdf
done
echo "Testing the transducer 'mm2mmm' with the input 'tests/mm2mmm-test.txt' (stdout)"
fstcompose compiled/mm2mmm-test.fst compiled/mm2mmm.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'd2dd' with the input 'tests/d2dd-test.txt' (stdout)"
fstcompose compiled/d2dd-test.fst compiled/d2dd.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'd2dddd' with the input 'tests/d2dddd-test.txt' (stdout)"
fstcompose compiled/d2dddd-test.fst compiled/d2dddd.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'copy' with the input 'tests/copy-test.txt' (stdout)"
fstcompose compiled/copy-test.fst compiled/copy.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'skip' with the input 'tests/skip-test.txt' (stdout)"
fstcompose compiled/skip-test.fst compiled/skip.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'date2year' with the input 'tests/date2year-test.txt' (stdout)"
fstcompose compiled/date2year-test.fst compiled/date2year.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'leap' with the input 'tests/leap-test.txt' (stdout)"
fstcompose compiled/leap-test.fst compiled/leap.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'R2A' with the input 'tests/R2A-test.txt' (stdout)"
fstcompose compiled/R2A-test.fst compiled/R2A.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'A2R' with the input 'tests/A2R-test.txt' (stdout)"
fstcompose compiled/A2R-test.fst compiled/A2R.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthR2A' with the input 'tests/birthR2A-test.txt' (stdout)"
fstcompose compiled/birthR2A-test.fst compiled/birthR2A.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthA2T' with the input 'tests/birthA2T-test.txt' (stdout)"
fstcompose compiled/birthA2T-test.fst compiled/birthA2T.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthT2R' with the input 'tests/birthT2R-test.txt' (stdout)"
fstcompose compiled/birthT2R-test.fst compiled/birthT2R.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthR2L' with the input 'tests/birthR2L-test.txt' (stdout)"
fstcompose compiled/birthR2L-test.fst compiled/birthR2L.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
# birthday tests
echo "Testing the transducer 'birthR2A' with the input 'tests/92509birthR2A.txt' (stdout)"
fstcompose compiled/92509birthR2A.fst compiled/birthR2A.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthA2T' with the input 'tests/92509birthA2T.txt' (stdout)"
fstcompose compiled/92509birthA2T.fst compiled/birthA2T.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthT2R' with the input 'tests/92509birthT2R.txt' (stdout)"
fstcompose compiled/92509birthT2R.fst compiled/birthT2R.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthR2L' with the input 'tests/92509birthR2L.txt' (stdout)"
fstcompose compiled/92509birthR2L.fst compiled/birthR2L.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthR2A' with the input 'tests/90760birthR2A.txt' (stdout)"
fstcompose compiled/90760birthR2A.fst compiled/birthR2A.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthA2T' with the input 'tests/90760birthA2T.txt' (stdout)"
fstcompose compiled/90760birthA2T.fst compiled/birthA2T.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthT2R' with the input 'tests/90760birthT2R.txt' (stdout)"
fstcompose compiled/90760birthT2R.fst compiled/birthT2R.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt
echo "Testing the transducer 'birthR2L' with the input 'tests/90760birthR2L.txt' (stdout)"
fstcompose compiled/90760birthR2L.fst compiled/birthR2L.fst | fstshortestpath | fstproject --project_type=output | fstrmepsilon | fsttopsort | fstprint --acceptor --isymbols=./syms.txt