webster1913

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package webster1913 parses Project Gutenberg's Webster's 1913 Unabridged Dictionary (http://www.gutenberg.org/ebooks/29765.txt.utf-8).

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

This section is empty.

Types

type Dict

type Dict []*Entry

Dict represents the parsed dictionary.

func Parse

func Parse(r io.Reader, progress func(i int, w string)) (Dict, error)

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

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