natasha/ipymarkup

Entity names shrinks to the shortes entity in the group

prohor33 opened this issue · 2 comments

Hi! I found some small bug.
Here is the example:

Top entity is short, so it's name. 3 other entities are pretty long, but their names are shrinked to the shortest (top) entity.
image

The same example with bigger line_gap:
image

If we make top entity longer all renders fine:
image

What expected to be correct behaviour: each name shrinkage corresponding to its entity length, not to the shortest entity in the group.
Thanks!

Also, could we make shrinkage with new lines, not with overlaps? Thx!

kuk commented

Thank you for bug report. Fixed in 0.9.0 pip install ipymarkup>=0.9.0

from ipymarkup import show_span_line_markup as show_markup

text = 'ИП Горбатов'
spans = [
    (0, 2, 'ОПФ'),
    (0, 10, 'Уча PER Кре'),
    (0, 10, 'Уча PER улк'),
]
show_markup(text, spans)

image