You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,7 +188,7 @@ The engine-internal `InputMode::Alphabet` (entered via Shift+letter on Linux/fci
188
188
- Models use jinen format with special Unicode tokens (U+EE00–U+EE02) from the Private Use Area; model input is katakana (hiragana is converted to katakana before inference)
189
189
- Model registry defined in `karukan-engine/models.toml`; default models use Q5_K_M quantization
190
190
- Live conversion (auto-suggest) splits the composing buffer into internal chunks of at most `composing_chunk_len` reading chars (default 40, configurable) so each model call stays bounded for long input. Chunking (`group_chunks`) starts a new chunk whenever the current one is full OR the character group changes between Japanese and non-Japanese (`is_japanese`: hiragana, katakana incl. `ー`, and kanji are Japanese; ASCII/full-width digits, letters, symbols, and all punctuation are non-Japanese). A non-Japanese run (digits/symbols/alphabet) is passed through to the preedit verbatim and never sent to the neural converter (which otherwise tends to drop digits mid-run, e.g. `123456`); a Japanese run is converted by the model. Because punctuation is non-Japanese, it forms its own chunk and naturally separates clauses (`今日は。明日` → `今日は`/`。`/`明日`), so there is no separate punctuation rule. A katakana word like `スーパーマーケット` is entirely Japanese, so it stays one chunk. `chunked_auto_suggest` re-chunks incrementally: it diffs the new buffer against the previous chunking by common character prefix/suffix and reconverts only the changed span (`ChunkPlan` decides which leading/trailing chunks to reuse). Each chunk's left context (lctx) is the editor surrounding text plus the converted text of the preceding chunks, truncated to `max_context_length`. Chunks are internal — the user sees one continuous preedit, and the aux text shows the current chunk's lctx as its single `lctx:`
191
-
- Learning cache records user-selected conversions and boosts them on subsequent conversions; candidate priority: Learning → User Dictionary → Model → System Dictionary → Fallback → Rewriter
191
+
- Learning cache records user-selected conversions and boosts them on subsequent conversions; candidate priority: Learning → User Dictionary → Model → System Dictionary → Fallback → Rewriter. Surfaces longer than `max_surface_chars` (default 50, `[learning]` in config.toml; both learning limits travel as `LearningConfig`) are not recorded. During conversion, Ctrl+Backspace or Ctrl+Delete (the Mac "delete" key is Backspace) removes the selected learning candidate from the history, mozc-style (`DeleteSelectedCandidate`): the removal clears the entry's whole prefix fan-out (`LearningCache::remove_suggestion`) so deduped twins under longer readings can't resurface, and the conversion is then rebuilt in place (mozc's cancel-and-reconvert, minus the window blink) so a surface that the model/dictionary/fallback also produce survives as an ordinary candidate. With a non-learning candidate selected the chord is consumed but does nothing (mozc's `DoNothing`); cancelling stays on plain Backspace/Escape; the chord exists only in the Conversion state (Composing keeps plain char editing). Deletability is derived from `Candidate::source` (`CandidateSource::is_deletable`, mozc's `USER_HISTORY_PREDICTION` analogue), and while a learning candidate is selected the aux text shows the mozc-style footer hint 「Ctrl+Backspaceで履歴から削除」
192
192
- Data files (system dictionary `dict.bin`, user dictionaries `user_dicts/`, learning cache `learning.tsv`) live in the data directory: `~/.local/share/karukan-im/` on Linux, `~/Library/Application Support/com.karukan.karukan-im/` on macOS; a prebuilt `dict.tgz` is published on GitHub releases
193
193
- Learning cache is persisted as TSV (`learning.tsv` in the data directory); saved on deactivate and engine free, not on every commit
194
194
- Learning score uses recency-weighted formula (mozc-inspired): `recency * 10.0 + ln(1 + frequency)`; eviction removes lowest-score entries when over `max_entries` (default: 10,000)
0 commit comments