importer

package
v0.0.0-...-6bbbb49 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	// The ID of the document.
	DocID int `json:"doc_id"`

	// URI of the document.
	URI string `json:"uri"`

	// Content of the document.
	Content string `json:"content"`
}

Document represents a document in a corpus. A document is a collection of tokens.

type FileImporter

type FileImporter struct {
}

This is a file importer It will implement the Importer interface It will import a corpus from a directory of files

func (*FileImporter) Import

func (fi *FileImporter) Import(params any) (*Import, error)

Import imports a corpus from a directory.

type FileImporterParams

type FileImporterParams struct {
	// Path of the corpus.
	Path string `json:"path"`

	// Filter of the corpus.
	Filter string `json:"filter"`
}

File Importer params.

type Import

type Import struct {
	// The name of the corpus.
	Name string `json:"name"`

	// Description of the corpus.
	Description string `json:"description"`

	// Source of the corpus.
	Source string `json:"source"`

	// URI of the corpus.
	URI string `json:"uri"`

	// The documents in the corpus.
	Documents []*Document `json:"documents"`
}

Import represents a corpus of documents. A corpus is a collection of documents.

type Importer

type Importer interface {
	// Import imports a corpus.
	Import(params any) (*Import, error)
}

Importer represents an importer.

type MemoryImporter

type MemoryImporter struct {
}

MemoryImporter import corpus from memory.

func (*MemoryImporter) Import

func (mi *MemoryImporter) Import(params any) (*Import, error)

Import imports a corpus from a directory.

type MemoryImporterParams

type MemoryImporterParams []string

File Importer params.

Jump to

Keyboard shortcuts

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