tag

package
v0.2.37 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package tag implements the core of span-tag: it runs a configuration forest of filters over intermediate schema records to produce a stream of tagged records.

Index

Constants

View Source
const DefaultPrefs = "85 55 89 60 50 105 34 101 53 49 28 48 121"

DefaultPrefs is the default source id preference order, most preferred first.

View Source
const LowPrio = 9999

LowPrio number, something that is larger than the number of data sources currently.

Variables

This section is empty.

Functions

func LoadTagger

func LoadTagger(config, unfreeze, expand string, verbose bool) (tagger filter.Tagger, cleanup func(), err error)

LoadTagger builds a filter.Tagger from a config (JSON string or file path), an optional frozen filterconfig, and optional meta-ISIL expansion rules (JSON string or file path). The returned cleanup function must be called to remove any temporary files created while unfreezing.

func Run

func Run(cfg Config, tagger filter.Tagger, r io.Reader, w io.Writer) error

Run tags intermediate schema records from r with the given tagger and writes the result to w.

Types

type Config

type Config struct {
	Server               string
	Prefs                string
	Verbose              bool
	IgnoreSameIdentifier bool
	DropDangling         bool
	BatchSize            int
	NumWorkers           int
}

Config holds the tunables for a tag run.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration.

type SelectResponse

type SelectResponse struct {
	Response struct {
		Docs []struct {
			ID          string   `json:"id"`
			Institution []string `json:"institution"`
			SourceID    string   `json:"source_id"`
		} `json:"docs"`
		NumFound int64 `json:"numFound"`
		Start    int64 `json:"start"`
	} `json:"response"`
	ResponseHeader struct {
		Params struct {
			Q  string `json:"q"`
			Wt string `json:"wt"`
		} `json:"params"`
		QTime  int64
		Status int64 `json:"status"`
	} `json:"responseHeader"`
}

SelectResponse with reduced fields.

Jump to

Keyboard shortcuts

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