Fix avg value calculation in bold/italic detection.
This commit is contained in:
parent
0a0e96ab3d
commit
afcab12b0c
1 changed files with 2 additions and 2 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue