pronom

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 24 Imported by: 12

Documentation

Overview

Define custom patterns (implementing the siegfried.Pattern interface) for the different patterns allowed by the PRONOM spec.

Package pronom implements the TNA's PRONOM signatures as a siegfried identifier

Index

Constants

View Source
const BeginningOfFile = pronombof

BeginningOfFile provides access to PRONOM's BOF const.

View Source
const EndOfFile = pronomeof

EndOfFile provides access to PRONOM's EOF const.

Variables

This section is empty.

Functions

func ExtensionSet added in v1.7.7

func ExtensionSet(path string) error

Extension set writes a sets file that links extensions to IDs.

func FormatPRONOM added in v1.9.0

func FormatPRONOM(id string, ps []PROCompatSequence) (frames.Signature, error)

FormatPRONOM is an external helper function for enabling the processing of a significant number of signature types compatible with the PRONOM standard from plain-old hex, to more complex PRONOM regex.

func GetReleases added in v1.7.1

func GetReleases(path string) error

func Harvest

func Harvest() []error

UTILS Harvest fetches PRONOM reports listed in the DROID file

func Load

func Load(ls *persist.LoadSaver) core.Identifier

Load reads PRONOM information back from the persist byte format into the Identifier's FormatInfo struct.

func LoadReleases added in v1.7.1

func LoadReleases(path string) (*mappings.Releases, error)

func New

func New(opts ...config.Option) (core.Identifier, error)

New creates a new PRONOM Identifier

func NewPronom

func NewPronom() (identifier.Parseable, error)

Pronom creates a pronom object

func ReleaseSet added in v1.7.1

func ReleaseSet(path string, releases *mappings.Releases) error

ReleaseSet writes a changes sets file based on the latest PRONOM release file

func Releases added in v1.7.1

func Releases(releases *mappings.Releases) ([]string, []string, map[string]map[string]int)

func TypeSets added in v1.7.1

func TypeSets(p1, p2, p3 string) error

TypeSets writes three sets files based on PRONOM reports: an all sets files, with all PUIDs; a families sets file with FormatFamilies; and a types sets file with FormatTypes.

Types

type Identification

type Identification struct {
	Namespace string
	ID        string
	Name      string
	Version   string
	MIME      string
	Class     string
	Basis     []string
	Warning   string
	// contains filtered or unexported fields
}

Identification records format related metadata.

func (Identification) Archive

func (id Identification) Archive() config.Archive

Archive returns the archive value for a given identification.

func (Identification) Known

func (id Identification) Known() bool

Known outputs true if the identification result isn't UNKNOWN.

func (Identification) String

func (id Identification) String() string

func (Identification) Values added in v1.7.1

func (id Identification) Values() []string

Values returns the Identification result information to the caller.

func (Identification) Warn

func (id Identification) Warn() string

Warn returns the associated warning for a given identification.

type Identifier

type Identifier struct {
	*identifier.Base // embedded base identifier
	// contains filtered or unexported fields
}

Identifier is the PRONOM implementation of the Identifier interface It wraps the base Identifier implementation with a formatinfo map

func (*Identifier) Fields

func (i *Identifier) Fields() []string

Fields returns the user-facing fields used in the Identifier's reports.

func (*Identifier) Recorder

func (i *Identifier) Recorder() core.Recorder

Recorder provides a new recorder for identification results.

func (*Identifier) Save

func (i *Identifier) Save(ls *persist.LoadSaver)

Save persists the PRONOM Identifier to disk

type NoClassIdentification added in v1.10.0

type NoClassIdentification struct {
	Identification
}

NoClassIdentification wraps Identification to implement the noclass option

func (NoClassIdentification) Values added in v1.10.0

func (nc NoClassIdentification) Values() []string

type PROCompatSequence added in v1.9.0

type PROCompatSequence = mappings.ByteSequence

PROCompatSequence (compatibility) provides access to the PRONON primitive mappings.ByteSequence for custom identifier types that want to make use of PRONOM's level of expression.

type Range

type Range struct {
	From, To []byte
}

func (Range) Equals

func (r Range) Equals(pat patterns.Pattern) bool

func (Range) Length

func (r Range) Length() (int, int)

func (Range) NumSequences

func (r Range) NumSequences() int

func (Range) Save

func (r Range) Save(ls *persist.LoadSaver)

func (Range) Sequences

func (r Range) Sequences() []patterns.Sequence

func (Range) String

func (r Range) String() string

func (Range) Test

func (r Range) Test(b []byte) ([]int, int)

func (Range) TestR

func (r Range) TestR(b []byte) ([]int, int)

type Recorder

type Recorder struct {
	*Identifier
	// contains filtered or unexported fields
}

Recorder stores information about match results.

func (*Recorder) Active

func (r *Recorder) Active(m core.MatcherType)

Active sets the flags for the recorder's active matchers.

func (*Recorder) Record

func (r *Recorder) Record(m core.MatcherType, res core.Result) bool

Record builds possible results sets associated with an identification.

func (*Recorder) Report

func (r *Recorder) Report() []core.Identification

Report organizes the results output and lists the highest priority results first.

func (*Recorder) Satisfied

func (r *Recorder) Satisfied(mt core.MatcherType) (bool, core.Hint)

Satisfied determines whether we should continue running identification with a given matcher type.

Directories

Path Synopsis
internal
mappings
Package mappings contains struct mappings to unmarshal three different PRONOM XML formats: the DROID signature file format, the report format, and the container format.
Package mappings contains struct mappings to unmarshal three different PRONOM XML formats: the DROID signature file format, the report format, and the container format.

Jump to

Keyboard shortcuts

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