Documentation
¶
Overview ¶
Package decoder provides a way to decode MDX/MDD file in a native way, rather than an external python scripts. It can provides users with easer usage of utilizing existed MDX dictionaries. For more details, please to refer to:
https://github.com/zhansliu/writemdict/blob/master/fileformat.md https://bitbucket.org/xwang/mdict-analysis/src
Index ¶
- type Header
- type MDict
- func (m *MDict) Close() error
- func (m *MDict) Decode(fileName string, lazy bool) error
- func (m *MDict) DumpData() error
- func (m *MDict) DumpDict(limit int) (map[string][]string, error)
- func (m *MDict) DumpKeys()
- func (m *MDict) Get(word string) string
- func (m *MDict) GetFile(name string) []byte
- func (m *MDict) Keys() []string
- func (m *MDict) ReadAtIndex(index int) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct {
GeneratedByEngineVersion string `xml:"GeneratedByEngineVersion,attr"`
RequiredEngineVersion string `xml:"RequiredEngineVersion,attr"`
Encrypted string `xml:"Encrypted,attr"`
Encoding string `xml:"Encoding,attr"`
Format string `xml:"Format,attr"`
CreationDate string `xml:"CreationDate,attr"`
Compact string `xml:"Compact,attr"`
Compat string `xml:"Compat,attr"`
KeyCaseSensitive string `xml:"KeyCaseSensitive,attr"`
Description string `xml:"Description,attr"`
Title string `xml:"Title,attr"`
DataSourceFormat string `xml:"DataSourceFormat,attr"`
StyleSheet string `xml:"StyleSheet,attr"`
RegisterBy string `xml:"RegisterBy,attr"`
RegCode string `xml:"RegCode,attr"`
}
type MDict ¶
type MDict struct {
// contains filtered or unexported fields
}
func (*MDict) DumpDict ¶
DumpDict may cost quite a long time, use it when you actually need the whole data
func (*MDict) GetFile ¶ added in v0.6.0
GetFile looks up a resource file by name in an MDD dictionary and returns its raw bytes. The name should be the filename as it appears in the MDD (e.g. "GB_hello0205.mp3"), without the leading backslash. Returns nil if not found.
func (*MDict) ReadAtIndex ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.