Documentation
¶
Index ¶
- type Config
- type Error
- type Glosbe
- type GlosbeMeanings
- type GlosbePhrase
- type GlosbeThing
- type PartOfSpeech
- type UrbanDictResp
- type UrbanDictThing
- type Vocabulary
- func (v Vocabulary) Antonyms(w string) ([]string, error)
- func (v Vocabulary) Meanings(w string) ([]string, error)
- func (v Vocabulary) PartOfSpeech(w string) ([]PartOfSpeech, error)
- func (v Vocabulary) Synonyms(w string) ([]string, error)
- func (v Vocabulary) UsageExample(w string) ([]string, error)
- func (v Vocabulary) Word(w string) (Word, error)
- type Word
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { BigHugeLabsApiKey string // API key from BigHugeLabs WordnikApiKey string // API key from Wordnik }
Config represents the configuration settings.
type Glosbe ¶
type Glosbe struct { Result string `json:"result"` Tuc []json.RawMessage `json:"tuc"` }
type GlosbeMeanings ¶
type GlosbeMeanings struct {
Things []GlosbeThing `json:"meanings"`
}
type GlosbePhrase ¶
type GlosbePhrase struct {
Thing GlosbeThing `json:"phrase"`
}
type GlosbeThing ¶
type GlosbeThing struct {
Text string `json:"text"`
}
type PartOfSpeech ¶
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 ¶
type UrbanDictResp struct {
Things []UrbanDictThing `json:"list"`
}
type UrbanDictThing ¶
type Vocabulary ¶
type Vocabulary struct {
// contains filtered or unexported fields
}
Vocabulary object represents an instance of vocabulary
func New ¶
func New(c *Config) (Vocabulary, error)
New Instantiates a new instance of Vocabulary with the passed config.
func (Vocabulary) Antonyms ¶
func (v Vocabulary) Antonyms(w string) ([]string, error)
Returns a list of strings representing the antonyms of the given word.
func (Vocabulary) Meanings ¶
func (v Vocabulary) Meanings(w string) ([]string, error)
Returns a list of strings representing the meanings of the given word.
func (Vocabulary) PartOfSpeech ¶
func (v Vocabulary) PartOfSpeech(w string) ([]PartOfSpeech, error)
Returns a list of PartOfSpeech structs representing the POS of the given word.
func (Vocabulary) Synonyms ¶
func (v Vocabulary) Synonyms(w string) ([]string, error)
Returns a list of strings representing the synonyms of the given word.
func (Vocabulary) UsageExample ¶
func (v Vocabulary) UsageExample(w string) ([]string, error)
Returns a list of strings representing usage examples of the given word.
type Word ¶
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
Click to show internal directories.
Click to hide internal directories.