vocabulary: github.com/karan/vocabulary Index | Files | Directories

package vocabulary

import "github.com/karan/vocabulary"

Index

Package Files

api_types.go vocabulary.go

type Config Uses

type Config struct {
    BigHugeLabsApiKey string // API key from BigHugeLabs
    WordnikApiKey     string // API key from Wordnik
}

Config represents the configuration settings.

type Error Uses

type Error string

Error represents an error.

func (Error) Error Uses

func (e Error) Error() string

Error implements the built-in error interface.

type Glosbe Uses

type Glosbe struct {
    Result string            `json:"result"`
    Tuc    []json.RawMessage `json:"tuc"`
}

type GlosbeMeanings Uses

type GlosbeMeanings struct {
    Things []GlosbeThing `json:"meanings"`
}

type GlosbePhrase Uses

type GlosbePhrase struct {
    Thing GlosbeThing `json:"phrase"`
}

type GlosbeThing Uses

type GlosbeThing struct {
    Text string `json:"text"`
}

type PartOfSpeech Uses

type PartOfSpeech struct {
    POS          string `json:"partOfSpeech"` // The part of speech for the word
    ExampleUsage string `json:"text"`         // An example usage for the word in POS
}

Represents the part of speech of a word

type UrbanDictResp Uses

type UrbanDictResp struct {
    Things []UrbanDictThing `json:"list"`
}

type UrbanDictThing Uses

type UrbanDictThing struct {
    Example    string `json:"example"`
    ThumbsUp   int    `json:"thumbs_up"`
    ThumbsDown int    `json:"thumbs_down"`
}

type Vocabulary Uses

type Vocabulary struct {
    // contains filtered or unexported fields
}

Vocabulary object represents an instance of vocabulary

func New Uses

func New(c *Config) (Vocabulary, error)

New Instantiates a new instance of Vocabulary with the passed config.

func (Vocabulary) Antonyms Uses

func (v Vocabulary) Antonyms(w string) ([]string, error)

Returns a list of strings representing the antonyms of the given word.

func (Vocabulary) Meanings Uses

func (v Vocabulary) Meanings(w string) ([]string, error)

Returns a list of strings representing the meanings of the given word.

func (Vocabulary) PartOfSpeech Uses

func (v Vocabulary) PartOfSpeech(w string) ([]PartOfSpeech, error)

Returns a list of PartOfSpeech structs representing the POS of the given word.

func (Vocabulary) Synonyms Uses

func (v Vocabulary) Synonyms(w string) ([]string, error)

Returns a list of strings representing the synonyms of the given word.

func (Vocabulary) UsageExample Uses

func (v Vocabulary) UsageExample(w string) ([]string, error)

Returns a list of strings representing usage examples of the given word.

func (Vocabulary) Word Uses

func (v Vocabulary) Word(w string) (Word, error)

Creates a new Word object collecting as much information as possible. Requires having all API keys.

type Word Uses

type Word struct {
    Word         string         // The original word in the query
    Meanings     []string       // A list of meanings for this word
    Synonyms     []string       // A list of synonyms for this word
    Antonyms     []string       // A list of antonyms for this word
    PartOfSpeech []PartOfSpeech // A list of part of speech for this word
    UsageExample []string       // A list of sentences showing usage example for the word
}

Represents a word with all its information

Directories

PathSynopsis
examples

Package vocabulary imports 5 packages (graph) and is imported by 2 packages. Updated 2016-07-22. Refresh now. Tools for package owners.