Skip to content

atselvan/dictionaryapi

Repository files navigation

dictionaryapi

A lightweight go module to access meanings of words using dictionaryapi.dev

Build Release reference Go Report Card codecov Quality Gate Status FOSSA Status License: MIT

Features

  • Get the meaning of a word

Installation

go get github.com/atselvan/dictionaryapi

Usage

Code

import (
	"fmt"
	"log"

	"github.com/atselvan/dictionaryapi"
)

func main() {
	dictionaryapi := dictionaryapi.NewClient()
	word, restErr := dictionaryapi.Word.Get("hello")
	if restErr != nil {
		log.Fatal(restErr)
	}
	fmt.Println(word)
}

Output

&{hello  [{ https://api.dictionaryapi.dev/media/pronunciations/en/hello-au.mp3} {/həˈləʊ/ https://api.dictionaryapi.dev/media/pronunciations/en/hello-uk.mp3} {/həˈloʊ/ }]  [{noun [{"Hello!" or an equivalent greeting.  [] []}]} {verb [{To greet with "hello".  [] []}]} {interjection [{A greeting (salutation) said when meeting someone or acknowledging someone’s arrival or presence. Hello, everyone. [] []} {A greeting used when answering the telephone. Hello? How may I help you? [] []} {A call for response if it is not clear if anyone is present or listening, or if a telephone conversation may have been disconnected. Hello? Is anyone there? [] []} {Used sarcastically to imply that the person addressed or referred to has done something the speaker or writer considers to be foolish. You just tried to start your car with your cell phone. Hello? [] []} {An expression of puzzlement or discovery. Hello! What’s going on here? [] []}]}]}

About

A lightweight go module to access meanings of words using https://dictionaryapi.dev

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages