Go library for reading MDX/MDD dictionary files.
- Read MDX dictionary files
- Read MDD resource files
- Support for compressed data (LZO)
- Keyword search and lookup
go get github.com/intellifuture/go-mdictimport go_mdict "github.com/intellifuture/go-mdict"
// Create a new mdict reader
mdict, err := go_mdict.New("path/to/dictionary.mdx")
if err != nil {
log.Fatal(err)
}
// Build index
if err := mdict.BuildIndex(); err != nil {
log.Fatal(err)
}
// Lookup a keyword
content, err := mdict.Lookup("keyword")
if err != nil {
log.Fatal(err)
}
// Get total entries count
count := mdict.GetTotalEntriesCount()[Add your license here]