textquality

package
v1.2.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package textquality detects text that was technically extracted from a document but is not actually usable - the classic "broken font encoding" failure mode of naive PDF/document text extraction, distinct from "there isn't much text" (see pdftext.Result.Sparse for that check). A PDF using a subsetted font with a missing or malformed ToUnicode character map can still yield plenty of characters per page, just not real ones.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGarbledText

func IsGarbledText(s string) bool

IsGarbledText reports whether s looks like broken text extraction rather than genuine content. Two independent signals, either sufficient on its own:

  • literal "(cid:NNN)" placeholders anywhere in s
  • more than 5% of runes falling in a Unicode Private Use Area

An empty or whitespace-only string is not "garbled" - that's a separate, simpler case (see pdftext.Result.Sparse) callers should check first.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL