<commit_before>HocrConverter
=============

Create PDFs and plain text from hOCR documents

Changes by C.Holtermann

Original script didn't work for me so I made some changes to make it work for me

My configuration is ocropus 0.7

The script is more verbose. It respects the use of filenames in ocropus hocr files.
The calculation of the text positions was inversed in height.

I made the skript draw the bounding boxes and made the text visible.

Like this the script is rather something to understand the concept.

Maybe it's useful for others trying to understand OCR.

Work in progress.<commit_msg>Credits to jbrinley<commit_after>HocrConverter
=============

Create PDFs and plain text from hOCR documents

Originally from jbrinley
See https://github.com/jbrinley/HocrConverter
and http://xplus3.net/2009/04/02/convert-hocr-to-pdf/

Changes by C.Holtermann

Original script didn't work for me so I made some changes to make it work for me

My configuration is ocropus 0.7

The script is more verbose. It respects the use of filenames in ocropus hocr files.
The calculation of the text positions was inversed in height.

I made the skript draw the bounding boxes and made the text visible.

Like this the script is rather something to understand the concept.

Maybe it's useful for others trying to understand OCR.

Work in progress.
{'fraction_non_alphanumeric': 0.053811659192825115, 'fraction_numerical': 0.009715994020926755, 'mean_word_length': 4.292490118577075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6827494', 'n_tokens_mistral': 385, 'n_tokens_neox': 362, 'n_words': 198}