Disable score-based dicritic detection, use the first matching body.
This commit is contained in:
parent
a7f2c332ca
commit
ad3fffd7bc
1 changed files with 3 additions and 2 deletions
|
|
@ -146,8 +146,9 @@ class Line(PageObject):
|
|||
if glyph.is_body():
|
||||
continue
|
||||
neighbours = neighbourhood(glyphs, i, 5)
|
||||
body = max(neighbours, key=lambda neighbour: neighbour.detect_diacritic(glyph))
|
||||
if body.detect_diacritic(glyph):
|
||||
possible_bodies = [body for body in neighbours if body.detect_diacritic(glyph)]
|
||||
if possible_bodies:
|
||||
body = possible_bodies[0]
|
||||
diacritics[body].append(glyph)
|
||||
bodies[glyph].append(body)
|
||||
return bodies, diacritics
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue