sdk-go: github.com/machinebox/sdk-go/textbox Index | Files

package textbox

import "github.com/machinebox/sdk-go/textbox"

Package textbox provides a client for accessing Textbox services.

Index

Package Files

textbox.go

type Analysis Uses

type Analysis struct {
    Sentences []Sentence `json:"sentences"`
    Keywords  []Keyword  `json:"keywords"`
}

Analysis represents an analysis of text.

type Client Uses

type Client struct {

    // HTTPClient is the http.Client that will be used to
    // make requests.
    HTTPClient *http.Client
    // contains filtered or unexported fields
}

Client is an HTTP client that can make requests to the box.

func New Uses

func New(addr string) *Client

New makes a new Client.

func (*Client) Check Uses

func (c *Client) Check(r io.Reader) (*Analysis, error)

Check passes the text from the Reader to Textbox for analysis.

func (*Client) Info Uses

func (c *Client) Info() (*boxutil.Info, error)

Info gets the details about the box.

type Entity Uses

type Entity struct {
    // Type is a string describing the kind of entity.
    Type string `json:"type"`
    // Text is the text of the entity.
    Text string `json:"text"`
    // Start is the absolute start position of the entity (in the original text).
    Start int `json:"start"`
    // Start is the absolute end position of the entity (in the original text).
    End int `json:"end"`
}

Entity represents an entity discovered in the text.

type ErrTextbox Uses

type ErrTextbox string

ErrTextbox represents an error from Textbox.

func (ErrTextbox) Error Uses

func (e ErrTextbox) Error() string

type Keyword Uses

type Keyword struct {
    Keyword string `json:"keyword"`
}

Keyword represents a key word.

type Sentence Uses

type Sentence struct {
    // Text is the text of the sentence.
    Text string `json:"text"`
    // Start is the absolute start position of the sentence (in the original text).
    Start int `json:"start"`
    // Start is the absolute end position of the sentence (in the original text).
    End int `json:"end"`
    // Sentiment is a probability score (between 0 and 1) of the sentiment of the sentence;
    // higher is more positive, lower is more negative.
    Sentiment float64 `json:"sentiment"`
    // Entities represents entities discovered in the text.
    Entities []Entity `json:"entities"`
}

Sentence represents a single sentence of text.

Package textbox imports 9 packages (graph) and is imported by 2 packages. Updated 2018-02-27. Refresh now. Tools for package owners.