webster1913

package
v0.0.0-...-fad336a Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StateNone is before the first entry.
	StateNone state = iota
	// StateEntryInfo is at the beginning of the entry.
	StateEntryInfo
	// StateEntryExtra is unclassified text in the entry.
	StateEntryExtra
	// StateEntryMeaningText is inside an entry's meaning's text.
	StateEntryMeaningText
	// StateEntryMeaningExample is inside an entry's meaning's example.
	StateEntryMeaningExample
	// StateEntrySynonym is inside an entry's synonym list.
	StateEntrySynonym
	// StateEntryPhraseDefn is inside an entry's phrase definition list.
	StateEntryPhraseDefn
)

Variables

This section is empty.

Functions

func Parse

func Parse(r io.Reader) ([]dict.Entry, error)

Types

type Dict

type Dict []*Entry

Dict represents the parsed dictionary.

func ParseDict

func ParseDict(r io.Reader) (Dict, error)

ParseDict parses Project Gutenberg's Webster's Unabridged Dictionary.

http://www.gutenberg.org/ebooks/29765.txt.utf-8

type Entry

type Entry struct {
	Headword    string
	Variant     []string
	Info        string
	Etymology   string
	Meanings    []*EntryMeaning
	Synonyms    []string
	PhraseDefns []string
	Extra       string // unparseable text
}

Entry is a single dictionary entry.

type EntryMeaning

type EntryMeaning struct {
	Text    string
	Example string
}

EntryMeaning is a meaning for a dictionary entry.

Jump to

Keyboard shortcuts

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