2018-04-26 01:04:50 +08:00
|
|
|
/**********************************************************************
|
|
|
|
* File: tovars.cpp (Formerly to_vars.c)
|
|
|
|
* Description: Variables used by textord.
|
|
|
|
* Author: Ray Smith
|
|
|
|
* Created: Tue Aug 24 16:55:02 BST 1993
|
|
|
|
*
|
|
|
|
* (C) Copyright 1993, Hewlett-Packard Ltd.
|
|
|
|
** Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
** you may not use this file except in compliance with the License.
|
|
|
|
** You may obtain a copy of the License at
|
|
|
|
** http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
** Unless required by applicable law or agreed to in writing, software
|
|
|
|
** distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
** See the License for the specific language governing permissions and
|
|
|
|
** limitations under the License.
|
|
|
|
*
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#include "tovars.h"
|
|
|
|
#include "params.h"
|
|
|
|
|
2019-05-26 22:43:43 +08:00
|
|
|
BOOL_VAR (textord_show_initial_words, false, "Display separate words");
|
|
|
|
BOOL_VAR (textord_show_new_words, false, "Display separate words");
|
|
|
|
BOOL_VAR (textord_show_fixed_words, false,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Display forced fixed pitch words");
|
2019-05-26 22:43:43 +08:00
|
|
|
BOOL_VAR (textord_blocksall_fixed, false, "Moan about prop blocks");
|
|
|
|
BOOL_VAR (textord_blocksall_prop, false,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Moan about fixed pitch blocks");
|
2019-05-26 22:43:43 +08:00
|
|
|
BOOL_VAR (textord_blocksall_testing, false, "Dump stats when moaning");
|
|
|
|
BOOL_VAR (textord_test_mode, false, "Do current test");
|
|
|
|
INT_VAR (textord_dotmatrix_gap, 3,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Max pixel gap for broken pixed pitch");
|
2019-05-26 22:43:43 +08:00
|
|
|
INT_VAR (textord_debug_block, 0, "Block to do debug on");
|
|
|
|
INT_VAR (textord_pitch_range, 2, "Max range test on pitch");
|
|
|
|
double_VAR (textord_wordstats_smooth_factor, 0.05,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Smoothing gap stats");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_width_smooth_factor, 0.10,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Smoothing width stats");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_words_width_ile, 0.4,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Ile of blob widths for space est");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_words_maxspace, 4.0, "Multiple of xheight");
|
|
|
|
double_VAR (textord_words_default_maxspace, 3.5,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Max believable third space");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_words_default_minspace, 0.6,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Fraction of xheight");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_words_min_minspace, 0.3, "Fraction of xheight");
|
|
|
|
double_VAR (textord_words_default_nonspace, 0.2,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Fraction of xheight");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR(textord_words_initial_lower, 0.25,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Max initial cluster size");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_words_initial_upper, 0.15,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Min initial cluster spacing");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_words_minlarge, 0.75,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Fraction of valid gaps needed");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_words_pitchsd_threshold, 0.040,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Pitch sync threshold");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_words_def_fixed, 0.016,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Threshold for definite fixed");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_words_def_prop, 0.090,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Threshold for definite prop");
|
2019-05-26 22:43:43 +08:00
|
|
|
INT_VAR (textord_words_veto_power, 5,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Rows required to outvote a veto");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_pitch_rowsimilarity, 0.08,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Fraction of xheight for sameness");
|
2019-05-26 22:43:43 +08:00
|
|
|
BOOL_VAR (textord_pitch_scalebigwords, false,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Scale scores on big words");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR(words_initial_lower, 0.5, "Max initial cluster size");
|
|
|
|
double_VAR (words_initial_upper, 0.15, "Min initial cluster spacing");
|
|
|
|
double_VAR (words_default_prop_nonspace, 0.25, "Fraction of xheight");
|
|
|
|
double_VAR (words_default_fixed_space, 0.75, "Fraction of xheight");
|
|
|
|
double_VAR (words_default_fixed_limit, 0.6, "Allowed size variance");
|
|
|
|
double_VAR (textord_words_definite_spread, 0.30,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Non-fuzzy spacing region");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_spacesize_ratiofp, 2.8,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Min ratio space/nonspace");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_spacesize_ratioprop, 2.0,
|
2018-04-26 01:04:50 +08:00
|
|
|
"Min ratio space/nonspace");
|
2019-05-26 22:43:43 +08:00
|
|
|
double_VAR (textord_fpiqr_ratio, 1.5, "Pitch IQR/Gap IQR threshold");
|
|
|
|
double_VAR (textord_max_pitch_iqr, 0.20, "Xh fraction noise in pitch");
|
|
|
|
double_VAR (textord_fp_min_width, 0.5, "Min width of decent blobs");
|