Benkyou is a local Japanese language learning application built with Python and PyQt6, designed to help users learn Japanese vocabulary through spaced repetition. The app follows a similar style to Anki, focusing on active recall and long-term retention.
- Language Learning App: Create a local Python application similar to Anki for Japanese vocabulary study
- Spaced Repetition: Implement spaced repetition algorithms to optimize learning retention
- Typing-Based Learning: Users type answers in Romanji, with real-time conversion to hiragana/katakana
- Bidirectional Learning: Support English→Japanese, Japanese→English, and mixed quiz modes
- Progress Persistence: Save and load user progress across app sessions
- Deck Management: Support multiple vocabulary decks with independent progress tracking
- Language: Python 3.13+
- GUI Framework: PyQt6 (≥6.9.1)
- Package Manager: UV
- Dependencies: See
pyproject.tomlfor current dependencies - Architecture: Object-oriented with modular design
benkyou/
├── main.py # Application entry point
├── spaced_repetition/ # Core spaced repetition logic
│ ├── __init__.py
│ └── card.py # Card class with SM-2 algorithm
├── vocab_files/ # Vocabulary deck storage
│ └── N5.csv # JLPT N5 vocabulary deck
├── pyproject.toml # Project configuration
└── README.md # Project documentation
The app implements a sophisticated spaced repetition algorithm via the Card class:
- Learning Phase: Cards start in "learning" status with graduated intervals (1min → 6min → 10min → 1day → 4days)
- Review Phase: Cards enter "reviewing" status with dynamic intervals based on ease factor
- Relearning: Failed cards return to "relearning" with adjusted intervals
- Ease Factor: Adaptive difficulty adjustment (1.3 minimum, increases with success)
- Deck System: Multiple vocabulary decks stored in
./vocab_files/ - CSV Format: Decks use CSV format with columns: [Japanese, Reading, English]
- Progress Tracking: Independent progress tracking per deck
- Deck Selection: Users choose which deck to study on app launch
- English → Japanese: Given English word, type Japanese in Romanji
- Japanese → English: Given Japanese word, type English meaning
- Mixed Mode: Random selection between the two modes for each card
- Romanji Input: Users type using standard Romanji (e.g., "benkyoushimasu") on English keyboard
- Dynamic Conversion: Real-time conversion to hiragana/katakana as user types
- Script Detection: Automatic detection of appropriate script (hiragana/katakana -> lower-case/upper-case)
- Usage Context: Conversion only occurs when translating from English to Japanese (English→Japanese mode)
- Script Convention: Katakana for uppercase, hiragana for lowercase
- Main Window: PyQt6-based main application window
- Card Manager: Handles card presentation and user interaction
- Progress Manager: Manages user progress persistence
- Deck Manager: Handles vocabulary deck loading and selection
User Input → Romanji Processing → Kana Conversion (English→Japanese only) → Answer Validation → Spaced Repetition Update → Progress Save
- Format: JSON-based progress files
- Location: User-specific progress directory
- Structure: Per-deck progress with card status, intervals, and ease factors
- Auto-save: Progress saved after each card interaction
- Clean Design: Modern, intuitive interface similar to Anki or Quizlet
- Smooth Experience: Optimized for fluid, responsive interactions with minimal lag
- Typing Interface: Dedicated typing area for user input with real-time feedback
- Answer Validation: Clear indication of correct/incorrect answers with corrections
- Responsive Layout: Adapts to different screen sizes
- Keyboard Navigation: Full keyboard support for efficient study
- Progress Indicators: Visual feedback on study progress and statistics
- Python 3.13+: Use modern Python features and type hints
- PEP 8: Follow Python style guidelines
- Documentation: Comprehensive docstrings for all classes and methods
- Type hints: Every function should have type hints and if necessary a docstring
- Error Handling: Robust error handling with user-friendly messages
- Efficient Algorithms: Optimize spaced repetition calculations
- Memory Management: Handle large vocabulary decks efficiently
- UI Responsiveness: Ensure smooth user experience during typing and conversion
- Audio Support: Pronunciation audio for vocabulary words
- Statistics Dashboard: Detailed learning analytics and progress charts
- Custom Decks: User-created vocabulary decks
- Export/Import: Progress backup and sharing functionality
- Mobile Support: Responsive design for tablet/phone use
- Grammar Integration: Basic grammar explanations and exercises
Note: These features are not currently planned for the initial implementation but may be added in future versions.
Current Dependencies:
- PyQt6 ≥6.9.1 (GUI framework)
- romkan (Romaji to Kana conversion) <- sourcecode from https://github.com/soimort
- simple-spaced-repetition <- sourcecode from https://github.com/vlopezferrando/simple-spaced-repetition
- Ensure Python 3.13+ is installed
- Install UV package manager
- Clone the repository
- Run
uv syncto install dependencies - Execute
python main.pyto start the application
- UV package manager installed
# Run the shell script
./build.sh- Clean Previous Builds: Remove old
dist/andbuild/directories - Install Dependencies: Add PyInstaller as a dev dependency and sync all packages
- Create Configuration: Generate a PyInstaller spec file optimized for your PyQt6 app
- Bundle Application: Create a standalone executable with all dependencies included
- Include Data Files: Automatically bundle your
vocab_files/andprogress_files/directories
- Windows:
dist/benkyou.exe- Standalone Windows executable - Linux/macOS:
dist/benkyou- Native executable for the target platform - Type: Standalone executable (no Python installation required)
- Size: Typically 50-100MB depending on dependencies
- Distribution: Can be shared with users on the same platform
- UV not found: Install UV from https://docs.astral.sh/uv/getting-started/installation/
- Build fails: Check that you're running the script from the project root directory
- Missing dependencies: The script automatically installs PyInstaller and syncs dependencies
Make a PR. I'll get an email and review it ASAP.