document

package
v0.0.0-...-90229f9 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 5 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 {
	Hash     string     `json:"hash"`
	Content  string     `json:"content"`
	Segments []*Segment `json:"segments,omitempty"`
}

Document starts with Content which is then analyzed

func New

func New(ctx context.Context, from string, steps ...Step) (*Document, error)

New takes the input string for segmenting and runs all segments through the steps before returning the final document

type Keyword

type Keyword struct {
	Key   string  `json:"key"`
	Value float64 `json:"value"`
}

Keyword as found inside a Segment

type Segment

type Segment struct {
	Text     string     `json:"text"`
	Keywords []*Keyword `json:"keywords,omitempty"`
}

Segment of a Document

type Step

type Step func(Segment) (Segment, error)

Step taking a segment and returning updated segment or error

Jump to

Keyboard shortcuts

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