From fda289071144c074919c2323b946fd41efb11f5a Mon Sep 17 00:00:00 2001 From: Andrey Golovizin Date: Mon, 8 Sep 2014 21:13:43 +0200 Subject: [PATCH] Output formats: allow tags with pure whitespace inside. --- pixelocr/formatting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixelocr/formatting.py b/pixelocr/formatting.py index 8c4c36e..07dd454 100644 --- a/pixelocr/formatting.py +++ b/pixelocr/formatting.py @@ -39,7 +39,7 @@ class OutputFormat(object): def fix_spaces(self, tagged_text): for tag, text in tagged_text: stripped_text = text.rstrip() - if len(stripped_text) < len(text): + if stripped_text and len(stripped_text) < len(text): traling_whitespace = text[len(stripped_text):] yield tag, stripped_text yield None, traling_whitespace