Add min_word_distance config variable.
This commit is contained in:
parent
c7743028b2
commit
3f0837d7dd
2 changed files with 3 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ class Configuration(BaseConfiguration):
|
||||||
allow_bold_italic = True
|
allow_bold_italic = True
|
||||||
|
|
||||||
min_body_height = 10
|
min_body_height = 10
|
||||||
|
min_word_distance = 15
|
||||||
|
|
||||||
diacritic_box_left = -3
|
diacritic_box_left = -3
|
||||||
diacritic_box_right = +3
|
diacritic_box_right = +3
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,8 @@ class Line(PageObject):
|
||||||
if glyph not in bodies: # freestanding diacritic-like glyph without a body
|
if glyph not in bodies: # freestanding diacritic-like glyph without a body
|
||||||
yield glyph
|
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 = []
|
current_word_glyphs = []
|
||||||
for glyph, next_glyph in pairwise(glyphs):
|
for glyph, next_glyph in pairwise(glyphs):
|
||||||
current_word_glyphs.append(glyph)
|
current_word_glyphs.append(glyph)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue