-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathJamroot
395 lines (340 loc) · 9.37 KB
/
Jamroot
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
include cxxflags.jam ;
project ppocr
: requirements
<include>src
<cxxflags>-std=c++17
<cxxflags>-fno-rtti
<toolset>clang:<cxxflags>-Wno-disabled-macro-expansion
<cxx-conversion-warnings>off
<conditional>@flags
<define>IMAGE_PATH='\"./tests/images/\"'
: default-build release
;
## Lib {
#lib libboost_unit_test : : <name>boost_unit_test_framework-mt <link>shared ;
#lib libboost_unit_test : : <name>boost_unit_test_framework <link>shared ;
#alias libunit_test : libboost_unit_test ;
lib libunit_test : tests/test_framework.cpp : <link>shared ;
## }
## Alias {
rule create_ppocr_rule ( srcs * )
{
local targets ;
for f in $(srcs)
{
local path = $(f:P) ;
local target = ppocr_$(path:B)_$(f:B).cpp.o ;
obj $(target) : $(f) ;
alias $(f).o : $(target) ;
targets += $(target) ;
}
alias ppocr : $(targets) ;
}
create_ppocr_rule
src/ppocr/box_char/box.cpp
src/ppocr/box_char/make_box_character.cpp
src/ppocr/image/coordinate.cpp
src/ppocr/image/image.cpp
src/ppocr/image/image_from_file.cpp
src/ppocr/image/image_from_string.cpp
src/ppocr/loader2/glyphs_loader.cpp
src/ppocr/loader2/image_io.cpp
src/ppocr/ocr2/data_indexes_by_words.cpp
src/ppocr/ocr2/disambiguous_with_dict.cpp
src/ppocr/ocr2/filter_by_font.cpp
src/ppocr/ocr2/filter_by_lines.cpp
src/ppocr/ocr2/glyphs.cpp
src/ppocr/ocr2/replacement.cpp
src/ppocr/ocr2/word_lines.cpp
src/ppocr/spell/dictionary.cpp
src/ppocr/strategies/alternations.cpp
src/ppocr/strategies/density.cpp
src/ppocr/strategies/dvdirection2.cpp
src/ppocr/strategies/dvdirection.cpp
src/ppocr/strategies/dvgravity2.cpp
src/ppocr/strategies/dvgravity.cpp
src/ppocr/strategies/dzdensity.cpp
src/ppocr/strategies/hbar.cpp
src/ppocr/strategies/hdirection2.cpp
src/ppocr/strategies/hdirection.cpp
src/ppocr/strategies/hgravity2.cpp
src/ppocr/strategies/hgravity.cpp
src/ppocr/strategies/proportionality.cpp
src/ppocr/strategies/proportionality_zone.cpp
src/ppocr/strategies/zone.cpp
src/ppocr/utils/image_compare.cpp
;
alias coordinate : src/ppocr/image/coordinate.cpp.o ;
alias box : src/ppocr/box_char/box.cpp.o ;
alias image : src/ppocr/image/image.cpp.o ;
alias image_from_file : src/ppocr/image/image_from_file.cpp.o ;
alias image_from_string : src/ppocr/image/image_from_string.cpp.o ;
alias dictionary : src/ppocr/spell/dictionary.cpp.o ;
alias glyphs_loader : src/ppocr/loader2/glyphs_loader.cpp.o ;
alias image_compare : src/ppocr/utils/image_compare.cpp.o ;
alias loader2_image_io : src/ppocr/loader2/image_io.cpp.o ;
alias strategies_src :
src/ppocr/strategies/alternations.cpp.o
src/ppocr/strategies/density.cpp.o
src/ppocr/strategies/dvdirection2.cpp.o
src/ppocr/strategies/dvdirection.cpp.o
src/ppocr/strategies/dvgravity2.cpp.o
src/ppocr/strategies/dvgravity.cpp.o
src/ppocr/strategies/dzdensity.cpp.o
src/ppocr/strategies/hbar.cpp.o
src/ppocr/strategies/hdirection2.cpp.o
src/ppocr/strategies/hdirection.cpp.o
src/ppocr/strategies/hgravity2.cpp.o
src/ppocr/strategies/hgravity.cpp.o
src/ppocr/strategies/proportionality.cpp.o
src/ppocr/strategies/proportionality_zone.cpp.o
src/ppocr/strategies/zone.cpp.o
;
alias image_src :
src/ppocr/image/coordinate.cpp.o
src/ppocr/image/image.cpp.o
;
alias image_from_file_src :
image_src
src/ppocr/image/image_from_file.cpp.o
;
alias box_character_src :
src/ppocr/box_char/box.cpp.o
src/ppocr/box_char/make_box_character.cpp.o
;
## }
## Exe {
exe make_trie_dictionary :
main/make_trie_dictionary.cpp
:
<library>dictionary
;
exe write_glyphs :
main/write_glyphs.cpp
:
<library>loader2_image_io
<library>glyphs_loader
<library>image_src
<library>box_character_src
<library>image_from_file_src
;
exe show_glyphs :
main/show_glyphs.cpp
:
<library>image_src
<library>box_character_src
<library>image_from_file_src
;
exe normalize_glyphs :
main/normalize_glyphs.cpp
:
<library>loader2_image_io
<library>glyphs_loader
<library>image_src
<library>image_compare
<library>box_character_src
<library>image_from_file_src
;
exe write_datas :
main/write_datas.cpp
:
<library>loader2_image_io
<library>strategies_src
<library>image_src
<library>box_character_src
<library>image_from_file_src
;
exe extract_text6 :
main/extract_text6.cpp
:
<library>image_compare
<library>glyphs_loader
<library>dictionary
<library>loader2_image_io
<library>strategies_src
<library>image_src
<library>box_character_src
<library>image_from_file_src
;
exe extract_text8 :
main/extract_text8.cpp
:
<library>image_compare
<library>glyphs_loader
<library>dictionary
<library>loader2_image_io
<library>strategies_src
<library>image_src
<library>box_character_src
<library>image_from_file_src
;
exe ocr2_extract_text :
main/ocr2_extract_text.cpp
:
<library>src/ppocr/ocr2/glyphs.cpp.o
<library>src/ppocr/ocr2/word_lines.cpp.o
<library>src/ppocr/ocr2/data_indexes_by_words.cpp.o
<library>src/ppocr/ocr2/filter_by_lines.cpp.o
<library>src/ppocr/ocr2/filter_by_font.cpp.o
<library>src/ppocr/ocr2/disambiguous_with_dict.cpp.o
<library>image_compare
<library>glyphs_loader
<library>dictionary
<library>loader2_image_io
<library>strategies_src
<library>image_src
<library>box_character_src
<library>image_from_file_src
;
## }
## Unit Tests {
import testing ;
alias image_from_string_src :
src/ppocr/image/image.cpp.o
src/ppocr/image/image_from_string.cpp.o
;
constant TEST_DEPENDENCIES :
<library>libunit_test
<toolset>clang:<cxxflags>-Wno-used-but-marked-unused
;
unit-test test_image :
tests/test_image.cpp
:
<library>src/ppocr/image/image.cpp.o
<library>src/ppocr/image/image_from_file.cpp.o
$(TEST_DEPENDENCIES)
;
unit-test test_make_box_character :
tests/test_make_box_character.cpp
:
<library>src/ppocr/box_char/make_box_character.cpp.o
<library>src/ppocr/image/image.cpp.o
<library>src/ppocr/image/image_from_file.cpp.o
$(TEST_DEPENDENCIES)
;
unit-test test_proportionality :
tests/strategies/test_proportionality.cpp
:
<library>src/ppocr/strategies/proportionality.cpp.o
<library>image_from_string_src
$(TEST_DEPENDENCIES)
;
unit-test test_proportionality_zone :
tests/strategies/test_proportionality_zone.cpp
:
<library>src/ppocr/strategies/proportionality_zone.cpp.o
<library>image_from_string_src
$(TEST_DEPENDENCIES)
;
unit-test test_alternations :
tests/strategies/test_alternations.cpp
:
<library>src/ppocr/strategies/alternations.cpp.o
<library>image_from_string_src
$(TEST_DEPENDENCIES)
;
unit-test test_hbar :
tests/strategies/test_hbar.cpp
:
<library>src/ppocr/strategies/hbar.cpp.o
<library>image_from_string_src
$(TEST_DEPENDENCIES)
;
unit-test test_hdirection :
tests/strategies/test_hdirection.cpp
:
<library>src/ppocr/strategies/hdirection.cpp.o
<library>image_from_string_src
$(TEST_DEPENDENCIES)
;
unit-test test_hdirection2 :
tests/strategies/test_hdirection2.cpp
:
<library>src/ppocr/strategies/hdirection2.cpp.o
<library>image_from_string_src
$(TEST_DEPENDENCIES)
;
unit-test test_hgravity :
tests/strategies/test_hgravity.cpp
:
<library>src/ppocr/strategies/hgravity.cpp.o
<library>image_from_string_src
$(TEST_DEPENDENCIES)
;
unit-test test_hgravity2 :
tests/strategies/test_hgravity2.cpp
:
<library>src/ppocr/strategies/hgravity2.cpp.o
<library>image_from_string_src
$(TEST_DEPENDENCIES)
;
unit-test test_zone :
tests/strategies/test_zone.cpp
:
<library>src/ppocr/strategies/zone.cpp.o
<library>image_from_string_src
$(TEST_DEPENDENCIES)
;
unit-test test_trie :
tests/container/test_trie.cpp
:
$(TEST_DEPENDENCIES)
;
unit-test test_word_disambiguouser :
tests/spell/test_word_disambiguouser.cpp
:
<library>dictionary
$(TEST_DEPENDENCIES)
;
unit-test test_dictionary :
tests/spell/test_dictionary.cpp
:
<library>dictionary
$(TEST_DEPENDENCIES)
;
unit-test test_datas_loader :
tests/loader2/test_datas_loader.cpp
:
<library>src/ppocr/strategies/hgravity.cpp.o
<library>src/ppocr/strategies/hdirection.cpp.o
<library>image
<library>image_from_string
$(TEST_DEPENDENCIES)
;
unit-test test_glyphs_loader :
tests/loader2/test_glyphs_loader.cpp
:
<library>loader2_image_io
<library>glyphs_loader
<library>coordinate
<library>image_compare
<library>image
<library>image_from_string
$(TEST_DEPENDENCIES)
;
unit-test test_reindex :
tests/utils/reindex.cpp
:
$(TEST_DEPENDENCIES)
;
unit-test test_compute_image :
tests/ocr2/test_compute_image.cpp
:
<library>src/ppocr/strategies/hdirection.cpp.o
<library>src/ppocr/ocr2/data_indexes_by_words.cpp.o
<library>coordinate
<library>image
<library>image_from_string
$(TEST_DEPENDENCIES)
;
actions run-ocr2-test {
rm -f $(<)
$(>) | grep ' ## result: пpимeчaниe - Bloc-notes' && touch $(<)
}
make test_ocr2_extract_text :
ocr2_extract_text
./resources/glyphs/normalized-glyphs-latin-cyrillic.txt
./resources/datas/latin-cyrillic.txt
tests/cyrillic.negate.pnm
./resources/words_lines-latin-cyrillic.txt
: run-ocr2-test : ;