From 9410952111b39054a221e8b99ef003f86109edb8 Mon Sep 17 00:00:00 2001 From: Andrey Golovizin Date: Tue, 26 Aug 2014 20:23:06 +0200 Subject: [PATCH] Increase minimal distance between words. --- pixelocr/page.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pixelocr/page.py b/pixelocr/page.py index 5dcc198..fe99752 100644 --- a/pixelocr/page.py +++ b/pixelocr/page.py @@ -206,12 +206,12 @@ class Line(PageObject): if glyph not in bodies: # freestanding diacritic-like glyphacter without a body yield glyph - def _insert_spaces(self, glyphs): + def _insert_spaces(self, glyphs, min_distance=10): for glyph, next_glyph in pairwise(glyphs): yield glyph if next_glyph is not None: distance = glyph.optical_distance(next_glyph) - if distance > 5: + if distance >= min_distance: yield Space(self.image.space(glyph.right, self.top, distance, self.height), self.baseline - self.top) def _extract_blob(self, blob_slice, label, labels):