pixelocr/pixelocr/config.py
2014-09-19 20:58:56 +02:00

48 lines
1.4 KiB
Python

# Copyright (C) 2014 Andrey Golovizin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from confire import Configuration as BaseConfiguration
class Configuration(BaseConfiguration):
allow_bold_italic = True
min_body_height = 10
min_word_distance = 15
space_width = 15
diacritic_box_left = -3
diacritic_box_right = +3
diacritic_box_top = -10
diacritic_box_bottom = +10
apostrophe_box_left = -5
apostrophe_box_right = +7
apostrophe_box_top = -5
apostrophe_box_bottom = +10
apostrophe_min_height = +3
apostrophe_max_distance = +4
dot_box_left = -3
dot_box_right = +3
dot_box_top = +1
dot_box_bottom = +10
@classmethod
def load_file(cls, filename):
class MyConfiguration(cls):
CONF_PATHS = [filename]
return MyConfiguration.load()