Back to godoc.org

Package document

v0.0.0-...-90229f9
Latest Go to latest

The highest tagged major version is .

Published: Jul 28, 2019 | License: MIT | Module: github.com/canonical-debate-lab/argument-analysis-research

Index

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier