zombiezen

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool(dbPath string, customParams ...string) (*sqlitex.Pool, error)

NewPool creates a new Zombiezen SQLite connection pool with reasonable defaults (e.g., WAL mode enabled).

Types

type CorpusStore added in v0.6.0

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

func NewCorpusStore added in v0.6.0

func NewCorpusStore(pool *sqlitex.Pool) *CorpusStore

func (*CorpusStore) AckNlp added in v0.7.0

func (s *CorpusStore) AckNlp(id string, by string) error

func (*CorpusStore) AckTxt added in v0.7.0

func (s *CorpusStore) AckTxt(id string, by string) error

func (*CorpusStore) AddLabel added in v0.8.0

func (s *CorpusStore) AddLabel(id string, labels ...string) (err error)

AddLabel adds labels to a document in the corpus.

func (*CorpusStore) ClearNlp added in v0.6.0

func (s *CorpusStore) ClearNlp(id string) error

func (*CorpusStore) Delete added in v0.8.0

func (s *CorpusStore) Delete(id string) error

Delete removes a document from the corpus by its ID.

func (*CorpusStore) DeleteLabel added in v0.8.0

func (s *CorpusStore) DeleteLabel(id string, labels ...string) (err error)

DeleteLabel deletes labels from a document in the corpus.

func (*CorpusStore) Exists added in v0.6.0

func (s *CorpusStore) Exists(id string) (bool, error)

Exists returns true if a record with the given ID is present in the docs table.

func (*CorpusStore) List added in v0.6.0

func (s *CorpusStore) List() ([]storage.CorpusMeta, error)

func (*CorpusStore) ListLabels added in v0.8.0

func (s *CorpusStore) ListLabels(labelSubStr string) ([]string, error)

ListLabels returns all labels (unique names) found in the corpus.

func (*CorpusStore) ReadMeta added in v0.6.0

func (s *CorpusStore) ReadMeta(id string) (storage.CorpusMeta, error)

ReadMeta retrieves full metadata for a given document ID.

func (*CorpusStore) ReadNlp added in v0.6.0

func (s *CorpusStore) ReadNlp(id string) ([]byte, error)

func (*CorpusStore) ReadTxt added in v0.6.0

func (s *CorpusStore) ReadTxt(id string) ([]byte, error)

ReadTxt retrieves the txt field for a given document ID as raw bytes.

func (*CorpusStore) UpdateTxt added in v0.7.0

func (s *CorpusStore) UpdateTxt(id string, txt []byte, txtHash string, by string, notes string) error

func (*CorpusStore) WriteNlp added in v0.6.0

func (s *CorpusStore) WriteNlp(id string, nlp []byte) error

func (*CorpusStore) WriteStream added in v0.6.0

func (s *CorpusStore) WriteStream(seq func(yield func(storage.CorpusRecord, error) bool)) (err error)

type DocStore

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

func NewDocStore

func NewDocStore(pool *sqlitex.Pool) *DocStore

func (*DocStore) DeleteLabelsOptimization added in v0.9.0

func (h *DocStore) DeleteLabelsOptimization(docID string) error

DeleteLabelsOptimization removes sentence_labels rows for docID.

func (*DocStore) DeleteLemmaOptimization added in v0.9.0

func (h *DocStore) DeleteLemmaOptimization(docID string) error

DeleteLemmaOptimization removes sentence_lemmas rows for docID.

func (*DocStore) DeleteMeta added in v0.9.0

func (h *DocStore) DeleteMeta(docID string) error

DeleteMeta removes the docs row for docID. Rows in the labels table are shared across documents and are not touched.

func (*DocStore) DeleteNlpData added in v0.9.0

func (h *DocStore) DeleteNlpData(docID string) error

DeleteNlpData removes all sentences rows for docID.

func (*DocStore) Exists added in v0.6.0

func (h *DocStore) Exists(id string) (bool, error)

Exists returns true if a document with the given ID is present in the docs table.

func (*DocStore) FindCandidates

func (h *DocStore) FindCandidates(lemmas []string, labelIDs []int, after storage.Cursor, limit int, onCandidate func(sent.Sentence) error) (storage.Cursor, error)

func (*DocStore) HasLabelsOptimization added in v0.6.0

func (h *DocStore) HasLabelsOptimization(id string) (bool, error)

func (*DocStore) HasLemmaOptimization added in v0.6.0

func (h *DocStore) HasLemmaOptimization(id string) (bool, error)

func (*DocStore) HasSentences added in v0.6.0

func (h *DocStore) HasSentences(id string) (bool, error)

HasSentences returns true if at least one sentence exists for the given doc ID.

func (*DocStore) List

func (h *DocStore) List() ([]sent.Meta, error)

func (*DocStore) ListLabels added in v0.6.0

func (h *DocStore) ListLabels(labelSubStr string) (sent.Labels, error)

func (*DocStore) Nlp added in v0.6.0

func (h *DocStore) Nlp(id string) ([]sent.Sentence, error)

func (*DocStore) UpdateLabels added in v0.9.0

func (h *DocStore) UpdateLabels(docID string, labels []string) (labelIDs []int, err error)

UpdateLabels upserts labels and updates the docs row for docID. Note: This operation does not remove labels from the labels table that are no longer referenced by this or any other document (orphaned labels).

func (*DocStore) WriteLabelsOptimization added in v0.6.0

func (h *DocStore) WriteLabelsOptimization(docID string, labelIDs []int) (err error)

Signature change: receives labelIDs directly from WriteMeta

func (*DocStore) WriteLemmaOptimization added in v0.6.0

func (h *DocStore) WriteLemmaOptimization(docID string, sentences []storage.SentenceIngest) (err error)

func (*DocStore) WriteMeta added in v0.6.0

func (h *DocStore) WriteMeta(id string, source string, labels []string) (labelIDs []int, err error)

func (*DocStore) WriteNlpData added in v0.6.0

func (h *DocStore) WriteNlpData(docID string, sentences []storage.SentenceIngest) (err error)

type SchemaManager added in v0.9.0

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

func NewSchemaManager added in v0.9.0

func NewSchemaManager(pool *sqlitex.Pool) *SchemaManager

func (*SchemaManager) Create added in v0.9.0

func (m *SchemaManager) Create(schemaName string) error

Create initializes the database with the given schema.

type TopicStore

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

func NewCorpusTopicStore added in v0.9.0

func NewCorpusTopicStore(pool *sqlitex.Pool) *TopicStore

func NewLiveTopicStore added in v0.9.0

func NewLiveTopicStore(pool *sqlitex.Pool) *TopicStore

func (*TopicStore) Delete added in v0.10.0

func (h *TopicStore) Delete(name string) error

func (*TopicStore) Read

func (h *TopicStore) Read(name string) (topic.Topic, error)

func (*TopicStore) ReadAll

func (h *TopicStore) ReadAll() (topic.Library, error)

func (*TopicStore) Write

func (h *TopicStore) Write(tp topic.Topic) error

Jump to

Keyboard shortcuts

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