Line._combine_diacritics(): do not lose freestanding diacritic-like symbols.
This commit is contained in:
parent
7c6faa6acd
commit
9b8a52e4c0
1 changed files with 2 additions and 2 deletions
|
|
@ -146,8 +146,6 @@ class Line(PageObject):
|
|||
bodies = defaultdict(list)
|
||||
diacritics = defaultdict(list)
|
||||
for i, glyph in enumerate(glyphs):
|
||||
if glyph.is_body():
|
||||
continue
|
||||
neighbours = neighbourhood(glyphs, i, 5)
|
||||
possible_bodies = [body for body in neighbours if body.detect_diacritic(glyph)]
|
||||
if possible_bodies:
|
||||
|
|
@ -204,6 +202,8 @@ class Glyph(PageObject):
|
|||
Higher score means higher probability. Zero means "absolutely not".
|
||||
"""
|
||||
|
||||
if not self.is_body():
|
||||
return 0
|
||||
if glyph.elevation > 0 and glyph.elevation < self.DIACRITIC_MIN_ELEVATION:
|
||||
return 0
|
||||
if glyph.top >= self.top and glyph.top < self.bottom:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue