Skip to main content

internal/infra/pg/refusalstore.go

internal/infra/pg · 65 lines · 5 declarations · source

Declarations

type RefusalStore

type RefusalStore struct {
pool *pgxpool.Pool
schema Schema
}

RefusalStore reads what extraction refused, as counts. A count by reason and predicate is what tells an operator whether the vocabulary is wrong (unmapped relations cluster on a predicate), the model is paraphrasing (unlocatable quotes) or repeating itself (duplicates), and it carries none of the words: the words are somebody's, and they are read only under a grant on the project they came from, through the memory routes.

source

func NewRefusalStore

func NewRefusalStore(pool *pgxpool.Pool, schema Schema) *RefusalStore

source

type RefusalCount

type RefusalCount struct {
Reason string `json:"reason"`
Predicate string `json:"predicate"`
Count int64 `json:"count"`
}

RefusalCount is how many proposals one predicate was refused for one reason.

source

type RefusalSummary

type RefusalSummary struct {
Scope string `json:"project"`
Total int64 `json:"total"`
Counts []RefusalCount `json:"counts"`
}

RefusalSummary is one project's refusals: the total and the counts, largest first, at most the limit; a predicate past the limit is in the total and not in the list.

source

method RefusalStore.Summary

func (s *RefusalStore) Summary(ctx context.Context, scope string, limit int) (RefusalSummary, error)

Summary counts one project's refusals by reason and predicate.

source