silvertext.
All posts
A side view in a preservation lab of an open bound volume in a V-shaped scanner cradle beneath two cameras, with gloved hands turning a page.

Engineeringengineering6 min read

How OCR Errors Change Document Similarity Before Matching Begins

An engineering review of how OCR, PDF extraction, reading order and hyphenation change text before similarity matching begins.

SESilvertext EngineeringOctober 16, 2026
5Maximum overlapping character 5-grams changed by one internal substitutionillustrative
2Token fragments produced by one unresolved line-end hyphenillustrative
3Linked representations to retain: extracted text, normalized text and page evidenceillustrative

1. Background

A scanned PDF is not always a text document. It may contain page images only, an OCR-generated text layer, or native PDF text mixed with scans. Most textual similarity systems must first turn that page into a character sequence or token sequence. That sequence is a derived representation, not the page itself.

Consider the printed phrase the allocation of public funds. OCR may produce the a1location of pubIic funds, replacing two lowercase l characters with 1 and I. A reader can often recover the intended words. Exact token matching cannot. Character-based matching preserves some evidence, but its overlap declines around the altered characters.

OCR is more than image-to-character substitution. Tesseract's documented system includes page-layout analysis as well as recognition.1 Post-OCR processing is therefore a separate stage, with methods that use lexicons, language models and local context to detect or correct likely errors.2

PDFs introduce a different source of error. The format is designed to reproduce page appearance. The order of content operations need not be the reading order, and tagged structure is optional.3 A two-column page can look correct while its extracted text alternates between columns or emits positioned fragments in an unusable sequence.

2. Method

This review separates acquisition, extraction, normalization and matching. The purpose is not to identify one universally correct text form. It is to show where visually identical passages can become different strings.

Let PP be the visible page, EE an extraction process, NN a normalization policy and GkG_k the set of character kk-grams produced from a string. One common document resemblance measure is Jaccard similarity over shingles, following Broder's framing of document resemblance and containment.4

x=N(E(P)),Jk(x,y)=∣Gk(x)∩Gk(y)∣∣Gk(x)∪Gk(y)∣x = N(E(P)), \qquad J_k(x,y) = \frac{\left|G_k(x) \cap G_k(y)\right|} {\left|G_k(x) \cup G_k(y)\right|}

The equation does not describe every checker. Token overlap, edit distance, semantic retrieval and passage alignment behave differently. It identifies the measurement boundary: changing E(P)E(P) changes every score calculated from its output.

A schematic records-room scanning station showing a two-column report under a scanner platen, with marked column boundaries and a line-end hyphen.
Figure 1. Concept diagram of the extraction boundary: the visible page, inferred reading order and extracted text stream are separate representations.

For a scanned or structurally uncertain source, retain three linked forms:

  1. Extracted text: exactly what the OCR engine or PDF parser emitted.
  2. Normalized text: a version with logged operations, such as Unicode normalization, whitespace collapse or a line-break hyphen decision.
  3. Page evidence: the page number, available coordinates and the source image or selectable text used to assess a candidate match.

These forms let a reviewer distinguish different writing from poor recognition or a normalization choice. They also prevent a system from silently rewriting a source to improve an apparent match.

3. Results

The table lists transformations that can occur before comparison. The examples are illustrative mechanisms, not measured error rates.

Stage Visible or intended source Extracted text example Likely matching effect
Character recognition public pubIic Exact token matching loses the word; some character overlap remains.
Line-end handling inter- followed by national inter- national One intended word is represented as two fragments.
Dehyphenation co-operate on one line cooperate A policy removes a printed, possibly meaningful hyphen.
Two-column order Left column, then right column Alternating lines from both columns Passage order becomes nonsensical.
Header retention Repeated journal title Header repeated on every page Boilerplate adds unhelpful shared text.

One internal character replacement can alter up to five overlapping character 5-grams when it is not near a string boundary. This is the first illustrative KPI. Token methods can be less tolerant: public and pubIic are distinct tokens unless a later correction or fuzzy-matching step treats them as related.

Hyphenation changes token boundaries, not just characters. A page may show inter- at the end of one line and national on the next. Joining the fragments is often useful, but it is an inference. A printed hyphen can be intentional, as in compounds, names and specialist vocabulary. Post-OCR correction research uses context because isolated character and token decisions are often ambiguous.2

Reading order changes adjacency. Shingles depend on adjacent characters, while phrase and passage methods depend on neighbouring tokens. If a two-column page is extracted as left line, right line, left line, right line, words from separate columns become neighbours. Words that were adjacent in one column are separated. This is a layout interpretation error, not a character-recognition error. It can affect native PDFs as well as scanned pages because visual placement and logical structure are distinct in PDF.3

Information-retrieval research has measured effects of OCR errors on ranking and relevance feedback in vector-space retrieval.5 The limited conclusion for similarity checking is that noisy text is not interchangeable with clean text. Representation choices change how the noise appears. A score still does not establish copying, independence or authorial intent.

4. Interpretation

The appropriate response is bounded, reviewable normalization. Not every irregularity should be repaired.

First, separate formatting normalization from uncertain textual repair. Converting a non-breaking space to a space or collapsing repeated extraction whitespace is easy to record and reverse. Replacing rn with m, joining every trailing hyphen or rearranging columns makes a stronger claim about the source. If such a transformation materially affects a candidate passage, the reviewer should be able to see it.

Second, use more than one representation for scan-heavy sources. An exact-token pass can identify clean copied passages. A character-oriented or edit-tolerant candidate-generation pass can surface variants affected by OCR. Candidate generation should lead to alignment against page evidence, not a conclusion on its own. Shingle resemblance depends on shingle length, tokenization and the text supplied to the method.4

Third, do not equate OCR confidence with similarity confidence. Where an engine provides recognition confidence, it concerns a recognition decision. Similarity concerns the relationship between two extracted representations. Reading order, omitted regions and normalization can affect that relationship even where individual characters look plausible.

For people checking their own writing, inspect a candidate excerpt against the source page when the cited source is a scan. If a selectable-text PDF has scrambled output, use another extraction route before treating an absent signal as evidence of no overlap. A low signal may reflect retrieval limits. A high signal may be a header, boilerplate or a passage that requires contextual review.

5. Limitations

This note reports no new benchmark, error rate or model comparison. OCR performance varies with typeface, language, scan resolution, page geometry, image degradation, training data and engine configuration. The cited work establishes relevant mechanisms, not a universal correction policy for a particular document collection.

There is a recall-fidelity trade-off. Aggressive fuzzy matching can recover passages that exact matching misses, but it can retrieve unrelated text. Aggressive dehyphenation can restore a word split by a line break, but it can erase a meaningful hyphen. Layout reconstruction can repair columns, but it can fail on sidebars, footnotes, tables and captions.

Similarity remains evidence for a person to interpret. OCR-aware processing can make that evidence easier to inspect. It cannot determine intent, establish plagiarism by itself or replace reading the original pages and their context.

References

  1. 1. Smith, Ray. 2007. “An Overview of the Tesseract OCR Engine.” Proceedings of the Ninth International Conference on Document Analysis and Recognition (ICDAR 2007), pp. 629-633. IEEE. https://doi.org/10.1109/ICDAR.2007.4376991 https://doi.org/10.1109/ICDAR.2007.4376991
  2. 2. Nguyen, Cuong, Anh Tuan Nguyen, and Masaki Nakagawa. 2021. “A Survey of Post-OCR Processing Approaches.” ACM Computing Surveys 54 (6), Article 124. Association for Computing Machinery. https://doi.org/10.1145/3453476 https://doi.org/10.1145/3453476
  3. 3. International Organization for Standardization. 2008. ISO 32000-1:2008, Document management — Portable document format — Part 1: PDF 1.7. ISO. https://www.iso.org/cms/live/live/en/sites/isoorg/contents/data/standard/05/15/51502.html?browse=tc https://www.iso.org/standard/51502.html
  4. 4. Broder, Andrei Z. 1997. “On the Resemblance and Containment of Documents.” Proceedings of Compression and Complexity of Sequences 1997, pp. 21-29. IEEE Computer Society. https://doi.org/10.1109/SEQUEN.1997.666900 https://doi.org/10.1109/SEQUEN.1997.666900
  5. 5. Taghva, Kazem, Julie Borsack, and Allen Condit. 1996. “The Effects of OCR Errors on Ranking and Feedback Using the Vector Space Model.” Proceedings of the Fifth Annual Symposium on Document Analysis and Information Retrieval (SDAIR 1996). https://dblp.org/rec/conf/sdair/TaghvaBC96.html https://dblp.org/rec/conf/sdair/TaghvaBC96.html