Fix avg value calculation in bold/italic detection.

This commit is contained in:
Andrey Golovizin 2014-09-15 23:19:39 +02:00
parent 0a0e96ab3d
commit afcab12b0c

View file

@ -291,8 +291,8 @@ class Word(PageObject):
if not known_glyph_info:
return None
total = sum(getattr(glyph_info.style, attr) for glyph_info in self._known_glyph_info())
avg = total / len(self.glyphs)
return avg > 0.5
avg = total / len(known_glyph_info)
return avg >= 0.5
@collect_iterable
def _known_glyph_info(self):