locsh

package
v0.209.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package locsh is the reference enrichment provider: it reconciles a Work's uncontrolled tags (feed genres, approved folksonomy) against Library of Congress Subject Headings via the public id.loc.gov suggest2 API, yielding controlled-subject candidates with label-match confidence. It demonstrates the Enricher shape for network reconciliation sources; deployments choose queue (moderated) or direct (auto-approve) execution.

Index

Constants

View Source
const Name = "locsh"

Name is the enricher's registry key and enrichment-graph name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enricher

type Enricher struct {
	// BaseURL overrides the id.loc.gov root (tests). Default production.
	BaseURL string
	// Client overrides the HTTP client. Default http.DefaultClient.
	Client *http.Client
	// MinConfidence drops weaker matches. Default 0.9 (exact label only).
	MinConfidence float64
}

Enricher reconciles tags against id.loc.gov.

func New

func New() *Enricher

New returns a production-configured Enricher.

func (*Enricher) Enrich

func (e *Enricher) Enrich(ctx context.Context, works []ingest.WorkSummary) ([]ingest.Enrichment, error)

Enrich implements ingest.Enricher: each distinct tag is looked up once per run (a shared cache across the batch), and matches at or above MinConfidence become subject candidates on every Work carrying the tag.

func (*Enricher) Name

func (e *Enricher) Name() string

Name implements ingest.Enricher.

Jump to

Keyboard shortcuts

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