Skip to content

ianlewis/go-stardict

Repository files navigation

go-stardict

Go Reference Tests Go Report Card

A stardict dictionary library for Go.

Status

The API is currently unstable and will change. This package will use module version numbering to manage versions and compatibility.

Features

  • 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).
  • Support for tree dictionaries (.tdx file).
  • Support for Resource Storage (res/ directory).

Installation

To install this package run

go get github.com/ianlewis/go-stardict

Examples

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)
  }
}

References

About

A stardict library for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages