Blazing-fast CLI Japanese
$i+1$ sentence miner & card generator for passive immersion.
Warning
🚧 Project Status: Active Beta / Under Heavy Development
kotonoha is currently in early active development (Beta). Features, tokenization rules, and sentence mining logic are actively evolving and not yet fully stable for production use. Expect bugs or incomplete functionality during this initial beta phase.
kotonoha is a high-performance terminal utility that scans Japanese anime subtitle files (.srt / .ass) and video files (.mkv / .mp4), extracts
- Optional subtitle setup: Use SubSink to download, generate, or synchronize a Japanese subtitle when you do not already have one.
- A matching Japanese subtitle file (
.srtor.ass) must be alongside your anime video for mining cards. ffmpegandmpvare required for audio and screenshot previews.
-
⚡ Sub-Millisecond Morphological Analysis: Powered by the official
sudachi.rsengine from WorksApplications. -
🎯 Smart
$i+1$ Candidate Filtering: Automatically identifies sentences containing 1 unknown content word and ranks them by JPDB frequency and sentence length. -
🖥️ 100% Terminal TUI: Fully keyboard-driven interactive card review using
inquire(arrow keys↑/↓andEnter). -
🎧 Non-Blocking Preview Audio: Background audio playback via
mpvdaemon—zero terminal freeze or input locking. -
🔎 Subtitle Inspector Playback: In
kotonoha --inspect, pressSpaceto hear the selected subtitle line without leaving the inspector. -
🎬 Single-Pass Media Extraction: Extracts precise audio snippets (
.mp3) and screenshot thumbnails (.jpg) viaffmpeg. -
📦 Embedded Zero-Dependency Database: Local SQLite storage (
~/.config/kotonoha/kotonoha.db) for known vocabulary, ignored words, and mined card history.
Paste this into your terminal to install kotonoha automatically:
curl -sSL https://raw.githubusercontent.com/Praveensenpai/kotonoha/main/install.sh | bashgit clone https://github.com/Praveensenpai/kotonoha.git
cd kotonoha
cargo build --release
install -Dm 755 target/release/kotonoha ~/.local/bin/kotonoha
install -Dm 644 completions/kotonoha.bash ~/.local/share/bash-completion/completions/kotonohaSimply run kotonoha without arguments to launch the interactive terminal file picker:
kotonohaPass a subtitle or video file path directly:
kotonoha "Ore wo Suki nano wa Omae dake ka yo - 01.mkv"The subtitle file must be next to the video and have a matching filename. If you need to generate subtitles first, try SubSink.
Inspect subtitle lines and hear the selected line without leaving the TUI:
kotonoha --inspect "Ore wo Suki nano wa Omae dake ka yo - 01.ja.srt"↑/↓ moves, Space plays or replays the selected subtitle, typing filters lines, and Backspace clears the filter. A matching video file enables playback.
| Component | Technology | Description |
|---|---|---|
| Language | Rust 2021 | Native speed & memory safety |
| Japanese NLP | sudachi.rs |
WorksApplications Japanese tokenizer & POS analyzer |
| Database | SQLite (rusqlite) |
Local storage for known words & mined cards |
| TUI Engine | ratatui, inquire & console |
Keyboard-driven subtitle inspector, prompts, and card boxes |
| Media Engine | ffmpeg & mpv |
Headless audio extraction and background preview |
Distributed under the MIT License.