Documentation ¶
Overview ¶
Package textbox provides a client for accessing Textbox services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analysis ¶
type Analysis struct { Sentences []Sentence `json:"sentences"` Keywords []Keyword `json:"keywords"` }
Analysis represents an analysis of text.
type Client ¶
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.
type Entity ¶
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 ¶
type ErrTextbox string
ErrTextbox represents an error from Textbox.
func (ErrTextbox) Error ¶
func (e ErrTextbox) Error() string
type Keyword ¶
type Keyword struct {
Keyword string `json:"keyword"`
}
Keyword represents a key word.
type Sentence ¶
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.
Click to show internal directories.
Click to hide internal directories.