Free Dictionary API
Description
The Free Dictionary API wrapper written in Go.
Usage
Installation
go get github.com/iamllcoolray/free-dictionary-api
Getting Started
import "github.com/iamllcoolray/free-dictionary-api"
func main() {
dictionary, err := dictionaryapi.Get("hello")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", dictionary)
fmt.Println(dictionaryapi.PrettierParseResponse(dictionary))
fmt.Printf("Word: %+v\n", dictionary[0].Word)
fmt.Printf("Phonetic: %+v\n", dictionary[0].Phonetic)
fmt.Printf("Phonetics/Text: %+v\n", dictionary[0].Phonetics[0].Text)
fmt.Printf("Phonetics/Audio: %+v\n", dictionary[0].Phonetics[0].Audio)
fmt.Printf("Origin: %+v\n", dictionary[0].Origin)
fmt.Printf("Meanings/Part of Speech: %+v\n", dictionary[0].Meanings[0].PartOfSpeech)
fmt.Printf("Meanings/Definition: %+v\n", dictionary[0].Meanings[0].Definitions[0].Definition)
fmt.Printf("Meanings/Example: %+v\n", dictionary[0].Meanings[0].Definitions[0].Example)
fmt.Printf("Meanings/Synonyms: %+v\n", dictionary[0].Meanings[0].Definitions[0].Synonyms)
fmt.Printf("Meanings/Antonyms: %+v\n", dictionary[0].Meanings[0].Definitions[0].Antonyms)
}
Issues
Need to make an easy/efficient way to grab specific data from the api call.