adapters

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyStyleReferenceParser

type AnyStyleReferenceParser struct {
	Runner  CommandRunner
	Version string
}

AnyStyleReferenceParser adapts Anystyle-like JSON reference output into model.ParsedDocument references.

func (AnyStyleReferenceParser) ParseReferences

func (p AnyStyleReferenceParser) ParseReferences(ctx context.Context, paperID string, bibliography []byte) (model.ParsedDocument, error)

type CERMINEXMLParser

type CERMINEXMLParser struct{ Version string }

func (CERMINEXMLParser) Parse

func (p CERMINEXMLParser) Parse(ctx context.Context, data []byte, options model.ParseOptions) (model.ParsedDocument, error)

type CommandRunner

type CommandRunner interface {
	Run(ctx context.Context, input []byte) ([]byte, error)
}

CommandRunner runs an optional external parser command.

type ExecCommandRunner

type ExecCommandRunner struct{ Command []string }

ExecCommandRunner invokes an external command and passes the bibliography on stdin.

func (ExecCommandRunner) Run

func (r ExecCommandRunner) Run(ctx context.Context, input []byte) ([]byte, error)

type GROBIDClient

type GROBIDClient struct {
	// contains filtered or unexported fields
}

GROBIDClient parses PDFs through a GROBID endpoint.

func NewGROBIDClient

func NewGROBIDClient(options GROBIDClientOptions) GROBIDClient

NewGROBIDClient creates a GROBID parser adapter.

func (GROBIDClient) Parse

func (c GROBIDClient) Parse(ctx context.Context, pdf []byte, options model.ParseOptions) (model.ParsedDocument, error)

Parse sends a PDF to GROBID and normalizes the returned TEI.

type GROBIDClientOptions

type GROBIDClientOptions struct {
	BaseURL     string
	Timeout     time.Duration
	Version     string
	MaxTEIBytes int64
}

GROBIDClientOptions configures the GROBID parser adapter.

type PaperMageJSONParser

type PaperMageJSONParser struct{}

PaperMageJSONParser adapts externally generated PaperMage-style layer JSON into model.ParsedDocument.

func (PaperMageJSONParser) Parse

Parse maps a conservative PaperMage layer export into ResearchForge's parsed-document model.

type ParserFallbackDecision

type ParserFallbackDecision struct {
	OrderedParsers         []string                 `json:"orderedParsers"`
	ConflictReviewRequired bool                     `json:"conflictReviewRequired"`
	NextAction             string                   `json:"nextAction"`
	Comparison             quality.ComparisonReport `json:"comparison"`
}

type ParserFallbackPolicy

type ParserFallbackPolicy struct {
	Parsers             []string `json:"parsers"`
	ReviewerRequired    bool     `json:"reviewerRequired"`
	AutoAcceptConflicts bool     `json:"autoAcceptConflicts"`
}

func DefaultParserFallbackPolicy

func DefaultParserFallbackPolicy() ParserFallbackPolicy

func (ParserFallbackPolicy) HasParser

func (p ParserFallbackPolicy) HasParser(name string) bool

func (ParserFallbackPolicy) Plan

type S2ORCJSONParser

type S2ORCJSONParser struct{ Version string }

S2ORCJSONParser adapts s2orc-doc2json-like JSON into model.ParsedDocument.

func (S2ORCJSONParser) Parse

func (p S2ORCJSONParser) Parse(ctx context.Context, data []byte, options model.ParseOptions) (model.ParsedDocument, error)

type TeXParser

type TeXParser struct{ Version string }

TeXParser extracts a lightweight model.ParsedDocument from arXiv TeX source.

func (TeXParser) Parse

func (p TeXParser) Parse(ctx context.Context, data []byte, options model.ParseOptions) (model.ParsedDocument, error)

Jump to

Keyboard shortcuts

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