Add min_word_distance config variable.

This commit is contained in:
Andrey Golovizin 2014-09-16 11:47:39 +02:00
parent c7743028b2
commit 3f0837d7dd
2 changed files with 3 additions and 1 deletions

View file

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

View file

@ -235,7 +235,8 @@ class Line(PageObject):
if glyph not in bodies: # freestanding diacritic-like glyph without a body
yield glyph
def _detect_words(self, glyphs, min_distance=15):
def _detect_words(self, glyphs):
min_distance = self.document.config.min_word_distance
current_word_glyphs = []
for glyph, next_glyph in pairwise(glyphs):
current_word_glyphs.append(glyph)