A stardict dictionary library for Go.
The API is currently unstable and will change. This package will use module version numbering to manage versions and compatibility.
- Reading dictionary metadata.
- Reading & searching the dictionary index.
- Reading full dictionary articles.
- Efficient access for large files.
- Dictzip support.
- Support for concurrent access.
- Synonym support (.syn file) (#2).
- Support for tree dictionaries (.tdx file) (#3).
- Support for Resource Storage (res/ directory) (#4).
- Glob/Wildcard search support (#21).
- Capitalization, diacritic, punctuation, and whitespace folding (#19, #25).
To install this package run
go get github.com/ianlewis/go-stardict
You can search a stardict dictionary directly and list the entries.
// Open dictonaries in a directory
dictionaries, _ := stardict.OpenAll(".")
// Search the dictionaries.
for _, d := range dictionaries {
entries, _ := d.Search("banana")
for _, e := range entries {
// Print out matching index entries.
fmt.Println(e)
}
}