@@ -267,10 +267,10 @@ generate_font_image() {
267
267
common_args+=" --leading=${LEADING} --xsize=${X_SIZE} "
268
268
common_args+=" --char_spacing=${CHAR_SPACING} --exposure=${EXPOSURE} "
269
269
common_args+=" --outputbase=${outbase} --max_pages=${MAX_PAGES} "
270
- if (( DISTORT_IMAGE)) ; then
270
+ if $ DISTORT_IMAGE; then
271
271
common_args+=" --distort_image "
272
272
fi
273
-
273
+
274
274
# add --writing_mode=vertical-upright to common_args if the font is
275
275
# specified to be rendered vertically.
276
276
for vfont in " ${VERTICAL_FONTS[@]} " ; do
@@ -284,7 +284,7 @@ generate_font_image() {
284
284
--text=${TRAINING_TEXT} ${TEXT2IMAGE_EXTRA_ARGS:- }
285
285
check_file_readable ${outbase} .box ${outbase} .tif
286
286
287
- if (( EXTRACT_FONT_PROPERTIES)) &&
287
+ if $ EXTRACT_FONT_PROPERTIES &&
288
288
[[ -r ${TRAIN_NGRAMS_FILE} ]]; then
289
289
tlog " Extracting font properties of ${font} "
290
290
run_command text2image ${common_args} --font=" ${font} " \
@@ -307,7 +307,7 @@ phase_I_generate_image() {
307
307
CHAR_SPACING=" 0.0"
308
308
309
309
for EXPOSURE in $EXPOSURES ; do
310
- if (( EXTRACT_FONT_PROPERTIES)) && [[ -r ${BIGRAM_FREQS_FILE} ]]; then
310
+ if $ EXTRACT_FONT_PROPERTIES && [[ -r ${BIGRAM_FREQS_FILE} ]]; then
311
311
# Parse .bigram_freqs file and compose a .train_ngrams file with text
312
312
# for tesseract to recognize during training. Take only the ngrams whose
313
313
# combined weight accounts for 95% of all the bigrams in the language.
@@ -485,7 +485,7 @@ phase_C_cluster_prototypes() {
485
485
486
486
# Phase S : (S)hape clustering
487
487
phase_S_cluster_shapes () {
488
- if (( ! RUN_SHAPE_CLUSTERING)) ; then
488
+ if ! $ RUN_SHAPE_CLUSTERING; then
489
489
tlog " \n=== Shape Clustering disabled ==="
490
490
return
491
491
fi
@@ -575,7 +575,7 @@ make__lstmdata() {
575
575
--output_dir " ${OUTPUT_DIR} " --lang " ${LANG_CODE} " \
576
576
" ${pass_through} " " ${lang_is_rtl} "
577
577
578
- if (( SAVE_BOX_TIFF)) ; then
578
+ if $ SAVE_BOX_TIFF; then
579
579
tlog " \n=== Saving box/tiff pairs for training data ==="
580
580
for f in " ${TRAINING_DIR} /${LANG_CODE} " .* .box; do
581
581
tlog " Moving ${f} to ${OUTPUT_DIR} "
@@ -620,7 +620,7 @@ make__traineddata() {
620
620
mkdir -p ${OUTPUT_DIR}
621
621
fi
622
622
local destfile=${OUTPUT_DIR} /${LANG_CODE} .traineddata;
623
- if [[ -f ${destfile} ]] && (( ! OVERWRITE)) ; then
623
+ if [[ -f ${destfile} ]] && ! $ OVERWRITE; then
624
624
err_exit " File ${destfile} exists and no --overwrite specified" ;
625
625
fi
626
626
tlog " Moving ${TRAINING_DIR} /${LANG_CODE} .traineddata to ${OUTPUT_DIR} "
0 commit comments