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

fix: add export to xml and html #17

Merged
merged 13 commits into from
Sep 18, 2024
8 changes: 4 additions & 4 deletions docling_core/types/doc/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,21 +410,21 @@ def get_special_tokens(
special_tokens = [token.value for token in cls]

# Adding dynamically generated row and col tokens
for i in range(0, max_rows):
for i in range(0, max_rows + 1):
special_tokens += [f"<row_{i}>", f"</row_{i}>"]

for i in range(0, max_cols):
for i in range(0, max_cols + 1):
special_tokens += [f"<col_{i}>", f"</col_{i}>"]

for i in range(6):
special_tokens += [f"<section-header-{i}>", f"</section-header-{i}>"]

# Adding dynamically generated page-tokens
for i in range(0, max_pages):
for i in range(0, max_pages + 1):
special_tokens.append(f"<page_{i}>")

# Adding dynamically generated location-tokens
for i in range(0, max(page_dimension[0], page_dimension[1])):
for i in range(0, max(page_dimension[0] + 1, page_dimension[1] + 1)):
special_tokens.append(f"<loc_{i}>")

return special_tokens
Expand Down
Loading