Documentation
¶
Index ¶
- func NewPool(dbPath string, customParams ...string) (*sqlitex.Pool, error)
- type CorpusStore
- func (s *CorpusStore) AckNlp(id string, by string) error
- func (s *CorpusStore) AckTxt(id string, by string) error
- func (s *CorpusStore) AddLabel(id string, labels ...string) (err error)
- func (s *CorpusStore) ClearNlp(id string) error
- func (s *CorpusStore) Delete(id string) error
- func (s *CorpusStore) DeleteLabel(id string, labels ...string) (err error)
- func (s *CorpusStore) Exists(id string) (bool, error)
- func (s *CorpusStore) List() ([]storage.CorpusMeta, error)
- func (s *CorpusStore) ListLabels(labelSubStr string) ([]string, error)
- func (s *CorpusStore) ReadMeta(id string) (storage.CorpusMeta, error)
- func (s *CorpusStore) ReadNlp(id string) ([]byte, error)
- func (s *CorpusStore) ReadTxt(id string) ([]byte, error)
- func (s *CorpusStore) UpdateTxt(id string, txt []byte, txtHash string, by string, notes string) error
- func (s *CorpusStore) WriteNlp(id string, nlp []byte) error
- func (s *CorpusStore) WriteStream(seq func(yield func(storage.CorpusRecord, error) bool)) (err error)
- type DocStore
- func (h *DocStore) DeleteLabelsOptimization(docID string) error
- func (h *DocStore) DeleteLemmaOptimization(docID string) error
- func (h *DocStore) DeleteMeta(docID string) error
- func (h *DocStore) DeleteNlpData(docID string) error
- func (h *DocStore) Exists(id string) (bool, error)
- func (h *DocStore) FindCandidates(lemmas []string, labelIDs []int, after storage.Cursor, limit int, ...) (storage.Cursor, error)
- func (h *DocStore) HasLabelsOptimization(id string) (bool, error)
- func (h *DocStore) HasLemmaOptimization(id string) (bool, error)
- func (h *DocStore) HasSentences(id string) (bool, error)
- func (h *DocStore) List() ([]sent.Meta, error)
- func (h *DocStore) ListLabels(labelSubStr string) (sent.Labels, error)
- func (h *DocStore) Nlp(id string) ([]sent.Sentence, error)
- func (h *DocStore) UpdateLabels(docID string, labels []string) (labelIDs []int, err error)
- func (h *DocStore) WriteLabelsOptimization(docID string, labelIDs []int) (err error)
- func (h *DocStore) WriteLemmaOptimization(docID string, sentences []storage.SentenceIngest) (err error)
- func (h *DocStore) WriteMeta(id string, source string, labels []string) (labelIDs []int, err error)
- func (h *DocStore) WriteNlpData(docID string, sentences []storage.SentenceIngest) (err error)
- type SchemaManager
- type TopicStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) 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 (*DocStore) DeleteLabelsOptimization ¶ added in v0.9.0
DeleteLabelsOptimization removes sentence_labels rows for docID.
func (*DocStore) DeleteLemmaOptimization ¶ added in v0.9.0
DeleteLemmaOptimization removes sentence_lemmas rows for docID.
func (*DocStore) DeleteMeta ¶ added in v0.9.0
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
DeleteNlpData removes all sentences rows for docID.
func (*DocStore) Exists ¶ added in v0.6.0
Exists returns true if a document with the given ID is present in the docs table.
func (*DocStore) FindCandidates ¶
func (*DocStore) HasLabelsOptimization ¶ added in v0.6.0
func (*DocStore) HasLemmaOptimization ¶ added in v0.6.0
func (*DocStore) HasSentences ¶ added in v0.6.0
HasSentences returns true if at least one sentence exists for the given doc ID.
func (*DocStore) ListLabels ¶ added in v0.6.0
func (*DocStore) UpdateLabels ¶ added in v0.9.0
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
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) 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