A Go application for downloading Lexin dictionary XML files. This tool provides a terminal user interface (TUI) to select and download Swedish bilingual dictionaries from the Lexin project.
- Interactive terminal UI for selecting languages
- Concurrent downloads with configurable concurrency
- Progress reporting during downloads
- Human-readable file sizes
- Organized output with metadata
- Ensure you have Go installed (version 1.18 or higher)
- Clone this repository
- Build the application:
go build -o lexin-downloader ./cmd/lexin
Or simply use the provided Makefile:
make build
./lexin-downloader [options]
-out string
: Output directory for downloads (default "lexin_downloads")-concurrency int
: Number of concurrent downloads (default 3)
- ↑/↓ or j/k: Navigate the list
- Space: Toggle selection of the current item
- a: Select/deselect all
- n: Deselect all
- Enter: Start downloading selected languages
- ?: Toggle help view
- q/ESC/Ctrl+C: Quit
lexin-downloader/
├── cmd/
│ └── lexin/
│ └── main.go # Main entry point
├── internal/
│ ├── models/
│ │ └── types.go # Data structures
│ ├── fetcher/
│ │ └── fetcher.go # Handles XML fetching
│ ├── parser/
│ │ └── parser.go # XML parsing
│ └── ui/
│ └── tui.go # Terminal UI
├── go.mod
└── go.sum
Downloads are organized by language code in the specified output directory. Each language directory contains:
- The XML dictionary files
- An index.html file
- A metadata.txt file with download information
- Bubble Tea - TUI framework
- Bubbles - TUI components
- Lip Gloss - Style definitions for terminal applications
- go-humanize - Human-readable formatting
To modify or extend this application:
- Clone the repository
- Install dependencies:
make deps
- Make your changes
- Format the code:
make fmt
- Build and test:
make run
MIT