Japanese Glossary Generator
An Anki add-on that automatically generates comprehensive glossaries for Japanese text with hiragana, katakana, and kanji information.
Features
- Automatic Glossary Generation: Processes Japanese text and creates detailed glossaries
- Multi-Character Support: Handles hiragana, katakana, and kanji characters
- Comprehensive Information: Provides readings, romaji, and meanings for each character
- Batch Processing: Process multiple notes efficiently with customizable performance settings
- API Caching: Intelligent caching system to improve performance and reduce API calls
- Customizable Templates: Flexible HTML templates for glossary formatting
- Progress Tracking: Real-time progress monitoring with detailed statistics
Installation
- Download the add-on from AnkiWeb or install manually
- Restart Anki
- The add-on will appear in the Tools menu as "Japanese Glossary Generator"
Usage
Basic Usage
- Go to Tools β Japanese Glossary Generator β Generate Glossary in Batch...
- Select your deck and note type
- Choose the source field containing Japanese text
- Select or create a target field for the glossary
- Click OK to start processing
Settings
Access settings via Tools β Japanese Glossary Generator β Settings...
General Settings
- Include Hiragana: Include hiragana characters in glossary
- Include Katakana: Include katakana characters in glossary
- Include Kanji: Include kanji characters in glossary
- Include Romaji: Add romaji readings for characters
- Include Meanings: Add English meanings for kanji
- Ignore Existing: Skip notes that already have glossary content
- Force Overwrite: Overwrite existing glossary content
Performance Settings
- Parallel Workers: Number of notes processed simultaneously per batch
- API Workers: Number of API calls per note processed simultaneously
- Batch Size: Number of notes processed in each batch
- Pause Between Batches: Delay between batches (in milliseconds)
- Pause per API Call: Delay between individual API calls (in milliseconds)
Cache Settings
- Enable Cache: Use local caching for API responses
- Maximum Cache Size: Limit for cache file size (in MB)
- Save Interval: How often to save cache to disk (in minutes)
API Services
This add-on uses the following external APIs:
- Romaji2Kana API (https://api.romaji2kana.com): For character reading conversions
- KanjiAPI (https://kanjiapi.dev): For kanji information and meanings
File Structure
japanese_glossary_generator/
βββ __init__.py # Main entry point
βββ config.py # Configuration management
βββ logger.py # Logging utilities
βββ cache.py # API cache management
βββ api_client.py # API communication
βββ stats.py # Statistics tracking
βββ text_utils.py # Text processing utilities
βββ glossary_generator.py # Core glossary generation
βββ templates.py # HTML templates
βββ processor.py # Main processing logic
βββ dialogs.py # UI dialogs
βββ manifest.json # Add-on manifest
βββ meta.json # Add-on metadata
βββ README.md # This file
Configuration Files
The add-on creates several files in its directory:
config.json: User settings and configuration
api_cache.json: Cached API responses
japanese_glossary_log.txt: Activity log file
Example Output
The generated glossary includes sections for each character type:
Hiragana
Katakana
Kanji
| Kanji |
δΊΊ |
| Readings |
On: γΈγ³ (jin), γγ³ (nin) Kun: γ²γ¨ (hito) |
| Meanings |
person, human being |
Troubleshooting
Common Issues
- No glossaries generated: Check that the source field contains Japanese text
- API errors: Verify internet connection and check the log file
- Performance issues: Adjust worker counts and batch sizes in settings
- Cache issues: Clear cache in settings if experiencing problems
Log File
View the log file via Tools β Japanese Glossary Generator β About... β View Log File to diagnose issues.
Performance Tips
- Start with smaller batch sizes and increase gradually
- Use caching to reduce API calls on repeated processing
- Adjust worker counts based on your system's capabilities
- Monitor the log file for any API rate limiting issues
Support
For issues, feature requests, or questions:
- Check the log file for error details
- Try adjusting performance settings
- Clear the cache if experiencing persistent issues
- Contact the add-on author with specific error messages
License
This add-on is provided as-is. See the license file for full terms.
Changelog
Version 2.1.1
- Complete rewrite with modular architecture
- Improved error handling and logging
- Enhanced caching system
- Better progress tracking
- Configurable templates
- Multiple API service support
Version 1.x
- Initial implementation
- Basic glossary generation
- Simple UI