define

package
v0.0.0-...-339e7a8 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Dictionary.com
	DictionaryCom = Endpoint{
		QueryURL: urlDictionaryCom,
		GetDefs:  scrapeDictionaryCom,
	}

	// lexico.com
	Lexico = Endpoint{
		QueryURL: urlLexico,
		GetDefs:  scrapeLexico,
	}

	// dictionary.cambridge.org
	Cambridge = Endpoint{
		QueryURL: urlCambridge,
		GetDefs:  scrapeCambridge,
	}
)

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	QueryURL func(string) string // Returns the url to search for a word
	GetDefs  ScrapeDefsFunc      // Returns the list of definitions
}

func (Endpoint) Define

func (e Endpoint) Define(word string) ([]string, error)

type ScrapeDefsFunc

type ScrapeDefsFunc func(*goquery.Document) []string

ScrapeDefsFunc will take a goquery document and scrape the definitions off of it

Jump to

Keyboard shortcuts

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