Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.11 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.11 KB

Build Status GoDoc Go Report Card Coverage Status

go-yandex-dictionary

Go Yandex Dictionary API wrapper

Usage:

package main

import (
  "fmt"
  "github.com/dafanasev/go-yandex-dictionary"
)

func main() {
  dict := dictionary.New("YOUR_API_KEY")

  langs, err := dict.GetLangs()

  if err != nil {
    fmt.Println(err)
  } else {
    fmt.Println(langs)
  }

  definition, err := dict.Lookup(&dictionary.Params{Lang: "en-ru", Text: "Dog"})

  if err != nil {
    fmt.Println(err)
  } else {
    fmt.Println(definition.Def[0].Text)
  }
}