txt

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityNER

type EntityNER interface {
	Formatter
}

EntityNER is the most important object for named entity recognition. It contains information about an entity found in a text.

type Formatter

type Formatter interface {
	ToJSON(pretty bool) ([]byte, error)
}

type PageNER

type PageNER interface {
	GetID() string
	TextNER
}

PageNER is an TextNER object that also includes meta-information about the page.

func NewPageNER

func NewPageNER(id string, text TextNER) PageNER

NNewPageNER is a PageNer factory.

type TextNER

type TextNER interface {
	// GetText retrievs the raw text represented by UTF-8 encoded runes.
	GetText() []rune

	// SetLinesEntitiesNum stores the number of found named entities per line.
	// The keys are line numbers, the values are numbers of entities for each
	// line.
	SetLinesEntitiesNum(lines map[int]int)

	// GetLinesEntitiesNum retrievs information about number of entities found
	// per line of text.
	GetLinesEntitiesNum() map[int]int

	// SetEntities stores information about all found in the text named entities.
	// Named entities can be scientific names, names of people, geographical
	// places, numbers etc.
	SetEntities(ents []EntityNER)

	// GetEntities retrievs information about all named entities found in the
	// text.
	GetEntities() []EntityNER

	// Formatter interface encodes the data in a format suitable for outputs.
	Formatter
}

TextNER represents the simplest object for named entities recognition. Higher level objects like PageNER and VolumeNER incorporate it.

func NewTextNER

func NewTextNER(text []rune) TextNER

NewTextNER takes the content of a text and returns a TextNER compatible object.

type VolumeNER

type VolumeNER interface {
	GetID() string
	SetPages(pages []PageNER)
	GetPages() []PageNER
	Formatter
}

VolumeNER is a book a magazine, a journal etc. It contains 0 or more pages and keeps its own meta-information.

func NewVolumeNER

func NewVolumeNER(id string) VolumeNER

NeNewVolumeNER is a factory for VolumeNER object.

Jump to

Keyboard shortcuts

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