dictionary

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	LookupWord(ctx context.Context, word string) ([]Definition, error)
	ContainsWord(ctx context.Context, word string) (bool, error)
	SaveWord(ctx context.Context, word string, defs []Definition) error
}

type CachedDefiner

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

func NewCachedDefiner

func NewCachedDefiner(c Cache, d Definer) *CachedDefiner

func (*CachedDefiner) Define

func (d *CachedDefiner) Define(ctx context.Context, word string) ([]Definition, error)

type Definer

type Definer interface {
	Define(ctx context.Context, word string) ([]Definition, error)
}

type Definition

type Definition struct {
	PartOfSpeech string
	Meaning      string
}

Definition is a single dictionary entry for a word

type WebAPI

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

WebAPI lets you interact with a dictionary API

func NewDefaultWebAPI

func NewDefaultWebAPI() WebAPI

NewDefaultWebAPI creates a new instance for connecting to a dictionary API

func (WebAPI) Define

func (api WebAPI) Define(ctx context.Context, word string) ([]Definition, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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