feat: source frequency ranks from installed Yomitan dictionaries

This commit is contained in:
2026-02-28 03:47:57 -08:00
parent 185528aee6
commit 93e392910c
21 changed files with 448 additions and 55 deletions

View File

@@ -757,7 +757,7 @@ See `config.example.jsonc` for detailed configuration options.
| `enableJlpt` | boolean | Enable JLPT level underline styling (`false` by default) |
| `preserveLineBreaks` | boolean | Preserve line breaks in visible overlay subtitle rendering (`false` by default). Enable to mirror mpv line layout. |
| `frequencyDictionary.enabled` | boolean | Enable frequency highlighting from dictionary lookups (`false` by default) |
| `frequencyDictionary.sourcePath` | string | Path to a local frequency dictionary root. Leave empty or omit to use the built-in bundled dictionary search paths. |
| `frequencyDictionary.sourcePath` | string | Path to a local frequency dictionary root. Leave empty or omit to use installed/default frequency-dictionary search paths. |
| `frequencyDictionary.topX` | number | Only color tokens whose frequency rank is `<= topX` (`1000` by default) |
| `frequencyDictionary.mode` | string | `"single"` or `"banded"` (`"single"` by default) |
| `frequencyDictionary.singleColor` | string | Color used for all highlighted tokens in single mode |
@@ -774,7 +774,7 @@ Frequency dictionary highlighting uses the same dictionary file format as JLPT b
Lookup behavior:
- Set `frequencyDictionary.sourcePath` to a directory containing `term_meta_bank_*.json` for a fully custom source.
- If `sourcePath` is missing or empty, SubMiner uses bundled defaults from `vendor/jiten_freq_global` (packaged under `<resources>/jiten_freq_global` in distribution builds).
- If `sourcePath` is missing or empty, SubMiner searches default install/runtime locations for `frequency-dictionary` directories (for example app resources, user data paths, and current working directory).
- In both cases, only terms with a valid `frequencyRank` are used; everything else falls back to no highlighting.
In `single` mode all highlights use `singleColor`; in `banded` mode tokens map to five ascending color bands from most common to least common inside the topX window.

View File

@@ -7,7 +7,7 @@ titleTemplate: Immersion Mining Workflow for MPV
hero:
name: SubMiner
text: Immersion Mining for MPV
tagline: Watch media, mine vocabulary, and build cards without leaving the scene.
tagline: Watch media, mine vocabulary, and craft anki cards without leaving the scene.
image:
src: /assets/SubMiner.png
alt: SubMiner logo
@@ -35,16 +35,11 @@ features:
alt: Anki card icon
title: Anki Card Enrichment
details: Auto-fills card fields with subtitle sentence, clipping, image, and translation so you can focus on learning.
- icon:
src: /assets/dual-layer.svg
alt: Dual layer icon
title: Unified Overlay Stack
details: Primary interactive subtitle layer with a built-in secondary context bar, all in one overlay window.
- icon:
src: /assets/highlight.svg
alt: Highlight icon
title: N+1 Highlighting
details: Surfaces known words from your deck so unknown targets stand out during immersion sessions.
title: Reading Annotations
details: Combines N+1 targeting, Jiten frequency highlighting, and JLPT tagging so useful cues stay visible while you read.
- icon:
src: /assets/tokenization.svg
alt: Tokenization icon
@@ -55,16 +50,6 @@ features:
alt: Subtitle download icon
title: Subtitle Download & Sync
details: Pull and synchronize subtitles with Jimaku plus alass/ffsubsync in one cohesive workflow.
- icon:
src: /assets/keyboard.svg
alt: Keyboard icon
title: Keyboard-Driven
details: Run lookups, mining actions, clipping, and workflow toggles with one configurable shortcut surface.
- icon:
src: /assets/texthooker.svg
alt: Texthooker icon
title: Texthooker & WebSocket
details: Stream subtitles in real time to browser tools via local WebSocket and keep your stack integrated.
---
<script setup>

View File

@@ -26,7 +26,7 @@ The expected files are:
Each bank maps terms to frequency metadata; only entries with a `frequency.displayValue` are considered for JLPT tagging.
SubMiner also reuses the same `term_meta_bank_*.json` format for frequency-based subtitle highlighting. The default frequency source is now bundled as `vendor/jiten_freq_global`, so users can enable `subtitleStyle.frequencyDictionary` without extra setup.
SubMiner also reuses the same `term_meta_bank_*.json` format for frequency-based subtitle highlighting, using installed/default `frequency-dictionary` locations or an explicit `subtitleStyle.frequencyDictionary.sourcePath`.
## Source and update process

View File

@@ -133,7 +133,7 @@
}, // Jlpt colors setting.
"frequencyDictionary": {
"enabled": false, // Enable frequency-dictionary-based highlighting based on token rank. Values: true | false
"sourcePath": "", // Optional absolute path to a frequency dictionary directory. If empty, built-in discovery search paths are used.
"sourcePath": "", // Optional absolute path to a frequency dictionary directory. If empty, SubMiner searches installed/default frequency-dictionary locations.
"topX": 1000, // Only color tokens with frequency rank <= topX (default: 1000).
"mode": "single", // single: use one color for all matching tokens. banded: use color ramp by frequency band. Values: single | banded
"singleColor": "#f5a97f", // Color used when frequencyDictionary.mode is `single`.