Add space_width config variable.

This commit is contained in:
Andrey Golovizin 2014-09-19 20:58:56 +02:00
parent 4275671c03
commit 5b1e84dd7f
2 changed files with 2 additions and 3 deletions

View file

@ -22,6 +22,7 @@ class Configuration(BaseConfiguration):
min_body_height = 10
min_word_distance = 15
space_width = 15
diacritic_box_left = -3
diacritic_box_right = +3

View file

@ -28,8 +28,6 @@ from .utils import cached_property
class Document(object):
SPACE_WIDTH = 15
def __init__(self, dirname, ui, skip=0, limit=None, output_format='text'):
super().__init__()
self.dirname = dirname
@ -61,7 +59,7 @@ class Document(object):
return ''.join(self.output_format.format(glyph_data_seq))
def recognize_line(self, line):
yield from [SPACE] * int(line.indent / self.SPACE_WIDTH)
yield from [SPACE] * int(line.indent / self.config.space_width)
for glyph in line.glyphs:
yield self.recognize_glyph(glyph)
yield NEWLINE