Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Неправильное определение размера шрифта #378

Closed
ValiullinAlbert opened this issue Nov 29, 2023 · 2 comments
Assignees

Comments

@ValiullinAlbert
Copy link

Приложение 2.docx

При считывании этого документа неправильно определяются размер шрифта:

import numpy as np
from dedoc.readers import DocxReader


filepath = "Приложение 2.docx"
reader = DocxReader(config={})
document = reader.read(filepath, parameters={"with_attachments": "false"})
for index, line in enumerate(document.lines):
    annotation = line.annotations
    wheres = (np.where(np.asarray([x.name for x in annotation]) == "size"))[0]
    print(line.line)
    for where in wheres:
        print(annotation[where])

Вывод следующий:

Приложение 2
к распоряжению 

Size(0:29, 12.0)


Соотношение долей командных и индивидуальных ключевых показателей эффективности для целей проведения оценки результативности работников 

Size(0:137, 12.0)
Size(44:45, 11.0)

В последней строке присутствуют 2 разных шрифта, при этом пересекающихся между собой

@NastyBoget
Copy link
Collaborator

Ошибка воспроизвелась, постараемся исправить в ближайшее время, спасибо!

@NastyBoget NastyBoget self-assigned this Nov 30, 2023
@NastyBoget
Copy link
Collaborator

Поправили в новой версии dedoc==2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants