textlayer

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationResult

type ValidationResult struct {
	Checked  bool
	Passed   bool
	Warnings []string
	Error    string
}

ValidationResult reports whether extracted output text matches the source text profile.

func MissingExtractor

func MissingExtractor() ValidationResult

MissingExtractor records optional extractor absence as a warning-only result.

func Validate

func Validate(source textprofile.ContentProfile, extracted string) ValidationResult

Validate compares extracted output text with source profile expectations.

Heuristics are intentionally deterministic and conservative:

  • unknown or non-text source profiles are warnings, not failures;
  • empty extracted text fails for known text sources;
  • Cyrillic sources must retain at least 5% Cyrillic letters;
  • f/l-dominated Latin output fails for Cyrillic sources because broken PDF text layers have been observed as repeated "f", "ff", and "flflfl";
  • replacement rune density above 2% fails as a generic corruption signal.

Jump to

Keyboard shortcuts

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