mw

package
v0.0.0-...-17324c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2019 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Overview

Package mw is merriam webster api client package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DT

type DT struct {
	Sx []string `xml:"sx"`
	V  string   `xml:",innerxml"`
}

DT represents holder for word defintion xml

type Definition

type Definition struct {
	EWord      string
	Date       string   // date of first recorded use
	Def        []string // definition field
	Type       string
	Synonymous []string
	Extera     string
}

Definition represents word definition with some description

type Entry

type Entry struct {
	XMLName xml.Name `xml:"entry"`
	ID      string   `xml:"id,attr"`
	Def     []DT     `xml:"def>dt"` // Defining Text
	FL      string   `xml:"fl"`     // Functional Label
	Date    string   `xml:"def>date"`
	Word    string   `xml:"ew"`
}

Entry represents merriam webster word definition section

type EntryList

type EntryList struct {
	XMLName     xml.Name `xml:"entry_list"`
	Version     string   `xml:"version,attr"`
	Entries     []Entry  `xml:"entry"`
	Suggestions []string `xml:"suggestion"`
}

EntryList represents list of entries.

type MerriamWebster

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

MerriamWebster contains information for create connection into merriam-webster

func New

func New(key string, dictionary string) *MerriamWebster

New creates merriam-webster object with given key and dictionary name

func (*MerriamWebster) Fetch

func (m *MerriamWebster) Fetch(word string) (*Word, []string, error)

Fetch word definition

type Word

type Word struct {
	Word        string
	Version     string
	Definitions []Definition
}

Word type contains word definations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL