How oliclice/vmtool works
VM-TOOL is a Chinese input-method dictionary-table manager with CLI and PyQt interfaces. Users add, query, edit, delete, import, and export entries; they can also generate codes, calculate weights, deduplicate/filter entries, and inspect statistics. The main runtime path is an interface calling application services, which use repositories and the SQLite persistence layer. GUI background threads create thread-local services. The README documents additional export targets and plugin support; some subsystem wiring is not present in the sampled source, so uncertain links are omitted.
Main entry points: dict.py Dictionary service · __main__.py CLI commands · tabs GUI feature tabs · threads GUI workers
Components 20
User interfaces
- CLI commands
vm-tool/ui/cli/__main__.py - GUI application
vm-tool/ui/gui/pyqt_app.py - GUI feature tabs
vm-tool/ui/gui/tabs - GUI settings
vm-tool/ui/gui/settings - GUI workers
vm-tool/ui/gui/threads
Dictionary operations
- Dictionary service
vm-tool/app/services/dict.py - Code generator
vm-tool/app/services/code_generator.py
Processing and reporting
- Weight calculator
vm-tool/app/services/weight.py - Filter and transfer
vm-tool/app/services/filter.py - Statistics service
vm-tool/app/services/stats.py - Frequency data
vm-tool/app/services/thuocl.py
Persistence
- Word repository
vm-tool/app/dal/repositories.py - Entry model
vm-tool/app/dal/models.py - SQLite database
vm-tool/app/dal/database.py
Configuration and extensions
- Runtime configuration
vm-tool/app/core/config_manager.py - Application cache
vm-tool/app/core/cache.py - Plugin manager
vm-tool/app/plugins/manager.py - Plugin API
vm-tool/app/plugins/base.py
Other components
- User
- Rime export directories
Connections 24
- User → CLI commands: runs commands
- User → GUI application: uses application
- CLI commands → Dictionary service: calls dictionary operations
- CLI commands → Weight calculator: requests weight calculation
- CLI commands → Code generator: requests code generation
- CLI commands → Filter and transfer: imports and exports
- CLI commands → Statistics service: requests statistics
- GUI application → GUI feature tabs: presents features
- GUI application → GUI settings: presents settings
- GUI feature tabs → Dictionary service: manages entries
- GUI feature tabs → Statistics service: requests statistics
- GUI feature tabs → GUI workers: starts background work
- GUI settings → Runtime configuration: reads and saves settings
- GUI workers → Dictionary service: creates thread-local service
- GUI workers → Weight calculator: creates thread-local calculator
- GUI workers → Filter and transfer: creates thread-local service
- Dictionary service → Word repository: reads and writes entries
- Dictionary service → Code generator: generates missing codes
- Weight calculator → Frequency data: uses frequency data
- Word repository → Entry model: queries entry model
- Word repository → SQLite database: persists entries
- Dictionary service → Application cache: uses operation cache
- Plugin manager → Plugin API: loads plugin implementations
- Dictionary service → Rime export directories: exports dictionary files