Skip to content

Strip Word's field error from document titles - #297

Merged
mt0rm0 merged 1 commit into
devfrom
281-strip-word-error-from-titles
Oct 16, 2026
Merged

mt0rm0 merged 1 commit into
devfrom
281-strip-word-error-from-titles

Conversation

@mt0rm0

@mt0rm0 mt0rm0 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Closes #281

Eleven indexed documents had "Fehler! Kein Text mit angegebener Formatvorlage im Dokument." in front of their title. That is Word's text for a broken StyleRef field, printed into the PDF by the authors' template. In WD 6-015-25 it was the whole title.

  • _clean_title removes the message, in German and in Word's English wording, and a document type it leaves at the front ("Aktueller Begriff …", "Kurzinformation …"). The type is only stripped where an error was removed, since elsewhere a title may legitimately start with such a word.
  • A labelled title that was nothing but the error falls back to the headings, like a document without a label.
  • The heading fallback no longer picks Docling's doubled boilerplate ("Wissenschaftliche Dienste Wissenschaftliche Dienste") or a "Dokumententyp:" heading. _deduplicate_title keeps leaving two-word phrases alone; the boilerplate check undoes the doubling on its own.

Existing documents keep their wrong titles until they are re-indexed. "Dokumente einlesen" skips documents already in the index, so the 11 files need a forced re-ingest or a withdraw and re-upload.

🤖 Generated with Claude Code

Eleven indexed documents carried "Fehler! Kein Text mit angegebener
Formatvorlage im Dokument." in front of their title, Word's text for a broken
StyleRef field printed into the PDF. Title extraction now removes it, in
German and English, together with a document type it leaves in front. A title
that was only the error falls back to the first real heading, and the heading
fallback no longer takes Docling's doubled boilerplate for a title.
@mt0rm0

mt0rm0 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Other infos

  • Backend offline suite green, mypy src clean. 6 new title tests.
  • All 11 affected PDFs were run through the real Docling parse and metadata extraction. All 11 titles came out clean, including WD 6-015-25 → "Dienstunfallfürsorge in Deutschland" and AB 02-25 → "Vor 80 Jahren: Befreiung der Konzentrations- und Vernichtungslager in Europa".

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 68910fea-8014-4f0d-b64c-9f82a08a1054

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mt0rm0

mt0rm0 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Correction to the note above: locally the offline suite was 631 passed, 2 failed. The two failures are the upload tests from #272 (401 because of the login in my local backend/.env). This branch was cut before #296 fixes that. With SENTRA_USERS= they pass, and CI has no .env.

@mt0rm0
mt0rm0 merged commit 5a19e20 into dev Oct 16, 2026
5 checks passed
@mt0rm0
mt0rm0 deleted the 281-strip-word-error-from-titles branch October 16, 2026 14:44
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

Successfully merging this pull request may close these issues.

1 participant