Documentation ¶
Overview ¶
Package edgedict interacts with MS Edge dictionaries.
Index ¶
- type Dictionary
- func (d *Dictionary) Close() error
- func (d *Dictionary) Entries() ([]Ref, error)
- func (d *Dictionary) Get(r Ref) ([]byte, error)
- func (d *Dictionary) Lookup(word string) ([]Entry, error)
- func (d *Dictionary) LookupRef(word string) ([]Ref, error)
- func (d *Dictionary) Walk(fn func(ref Ref, buf []byte) error) error
- func (d *Dictionary) WalkRefs(fn func(term string, ref Ref) error) error
- func (d *Dictionary) Words() ([]string, error)
- type Entry
- type Item
- type Meaning
- type MeaningGroup
- type PronunciationAudio
- type Ref
- type RichDefinition
- type RichDefinitionFragment
- type WordForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
Dictionary provides read access to the contents of a MS Edge dictionary.
func New ¶
func New(r io.ReaderAt) (*Dictionary, error)
New opens a MS Edge dictionary from a ReaderAt supporting seeking.
func Open ¶
func Open(name string) (*Dictionary, error)
Open opens a MS Edge dictionary from a path.
func (*Dictionary) Entries ¶
func (d *Dictionary) Entries() ([]Ref, error)
Entries gets references to all unique definitions from the dictionary.
func (*Dictionary) Get ¶
func (d *Dictionary) Get(r Ref) ([]byte, error)
Get gets the raw entry referenced by r.
func (*Dictionary) Lookup ¶
func (d *Dictionary) Lookup(word string) ([]Entry, error)
Lookup finds a word in the dictionary and returns the definition(s). If the word does not exist, a nil slice will be returned.
func (*Dictionary) LookupRef ¶
func (d *Dictionary) LookupRef(word string) ([]Ref, error)
LookupRef finds an entry in the dictionary. If the word does not exist, a nil err and slice will be returned.
func (*Dictionary) Walk ¶
func (d *Dictionary) Walk(fn func(ref Ref, buf []byte) error) error
Walk efficiently iterates over all unique definitions from the dictionary, breaking if fn returns a non-nil error.
func (*Dictionary) WalkRefs ¶ added in v0.0.3
func (d *Dictionary) WalkRefs(fn func(term string, ref Ref) error) error
WalkRefs efficiently iterates over all word references from the dictionary, breaking if fn returns a non-nil error.
func (*Dictionary) Words ¶
func (d *Dictionary) Words() ([]string, error)
Words gets all words from the dictionary.
type Entry ¶
type Entry struct { Name string `json:"name"` PhoneticName string `json:"phoneticName"` Pronunciation string `json:"pronunciation"` PronunciationAudio PronunciationAudio `json:"pronunciationAudio"` MeaningGroups []MeaningGroup `json:"meaningGroups"` WordOrigin string `json:"wordOrigin"` AggregatePartsOfSpeech Item `json:"aggregatePartsOfSpeech"` }
type Meaning ¶
type Meaning struct {
RichDefinitions []RichDefinition `json:"richDefinitions"`
}
type MeaningGroup ¶
type PronunciationAudio ¶
type PronunciationAudio struct {
ContentURL string `json:"contentUrl"`
}
type Ref ¶
type Ref struct {
// contains filtered or unexported fields
}
Ref points to a definition.
type RichDefinition ¶
type RichDefinition struct { Fragments []RichDefinitionFragment `json:"fragments"` Domains []string `json:"domains"` Synonyms []Item `json:"synonyms"` Examples []string `json:"examples"` LabelTags []string `json:"labelTags"` Antonyms []Item `json:"antonyms"` SubDefinitions []RichDefinition `json:"subDefinitions"` }
type RichDefinitionFragment ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
edgedict-fetch
Command edgedict-fetch downloads and extracts MS Edge dictionaries.
|
Command edgedict-fetch downloads and extracts MS Edge dictionaries. |