Skip to content
Merged
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

## [Unreleased]

## [0.8.0] - 2026-04-20

Comment thread
harumiWeb marked this conversation as resolved.
### Added

- 語彙データを追加しました。コア語彙数は合計10165個です。
Comment thread
harumiWeb marked this conversation as resolved.

Comment thread
harumiWeb marked this conversation as resolved.
## [0.7.2] - 2026-04-11

### Changed
Expand Down Expand Up @@ -200,7 +206,8 @@
- 通知不要時に古い update tag が画面に残る問題を修正しました。
- `dev` など非 semver の build でも update availability を正しく判定するようにしました。

[Unreleased]: https://github.com/harumiWeb/eitango/compare/v0.7.2...HEAD
[Unreleased]: https://github.com/harumiWeb/eitango/compare/v0.8.0...HEAD
[0.8.0]: https://github.com/harumiWeb/eitango/compare/v0.7.2...v0.8.0
[0.7.2]: https://github.com/harumiWeb/eitango/compare/v0.7.1...v0.7.2
[0.7.1]: https://github.com/harumiWeb/eitango/compare/v0.7.0...v0.7.1
[0.7.0]: https://github.com/harumiWeb/eitango/compare/v0.6.1...v0.7.0
Expand Down
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

In addition to SRS-based review, it offers two modes: multiple-choice `choice` and input-based `write`. Audio playback is also supported.

The embedded vocabulary currently contains about **8000** words, and external dictionary import from CSV / JSONL is also supported. The tool includes learning statistics, progress management, update notifications, and diagnostic tools.
The embedded vocabulary currently contains **10165** words, and external dictionary import from CSV / JSONL is also supported. The tool includes learning statistics, progress management, update notifications, and diagnostic tools.

[日本語README](README.md) / [Contributing Guide](CONTRIBUTING.md) / [Security Policy](SECURITY.md)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

SRS での復習に加えて、選択式の `choice` と入力式の `write` の 2 モードを用意していて、音声再生もサポートしています。

デフォルトで内部に語彙が組み込まれており(現在の語彙数: 約**8000**)、外部 CSV / JSONL からの辞書インポートもサポートしています。学習統計や進捗管理、更新通知、診断ツールも備えています。
デフォルトで内部に語彙が組み込まれており(現在の語彙数: **10165**)、外部 CSV / JSONL からの辞書インポートもサポートしています。学習統計や進捗管理、更新通知、診断ツールも備えています。

[English README](README.en.md) / [コントリビューションガイド](CONTRIBUTING.md) / [Security Policy](SECURITY.md)

Expand Down
2,127 changes: 2,127 additions & 0 deletions assets/words_core.jsonl

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/adr/0002-bundled-core-dictionary-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- bundled core は `dict.LoadCoreWords()` で parse と validation を通したうえで seed する。core では `lemma`, `meaning_ja`, `pos`, `level`, `frequency_rank`, `distractor_group` を必須とし、`(lemma, pos)` と `frequency_rank` の重複を許さず、各 `distractor_group` は最低 4 語を要求する。
- bundled core の版は `dict.CoreWordsVersion` で管理し、DB 内では `app_meta.dict_version` と `source = "core"` を使って現在の seed 状態を追跡する。
- 初回 seed で core 語彙を投入し、`dict_version` が変わった場合は `source = "core"` の既存 row を `normalized(lemma, pos)` 単位で差分同期する。matched row は同じ `word_id` を維持したまま metadata を更新し、新語だけを追加し、消えた旧 core row は inactive として退役させる。
- current session item が prompt や distractor の snapshot を持たない現行設計では、core version bump 後に active session を安全に再開できない。そのため core diff sync 前に active session は `abandoned` へ倒す。
- `reset --reseed` は bundled core の明示的な破壊的再投入導線として残し、core source を全置換したうえで学習履歴テーブルもリセットする。
- import 語彙は `import:*` source として core から分離し、`core` は予約済み source として扱う。
- raw の Leipzig / Japanese WordNet 入力は配布物へ含めず、再生成条件は `scripts/vocab/source_manifest.json` と repository tooling に固定する。
Expand All @@ -22,6 +23,7 @@

- 学習時に参照する core 辞書の品質と整合性を、アプリ起動時 validation と DB metadata の両方で担保できる。
- core 更新時も matched row の `word_id` と SRS 履歴を保持できるため、bundled core の語彙追加や軽微な metadata 更新を学習進捗の全消去なしで配布できる。
- version bump 直前に active session があった場合は自動再開せず、利用者は新しい core 内容に対して session を開始し直す必要がある。
- 退役した core 語彙を inactive row として残すため、過去 session・review・export の参照整合性を壊さずに新規計画対象からだけ除外できる。
- core と import を source で分けるため、標準辞書の更新とユーザー追加データの保守方針を分離できる。
- core の版更新は `normalized(lemma, pos)` を軸にした互換性契約を伴うため、同一 key の語は同じ学習対象として扱える範囲の更新に留める必要がある。
Expand Down
26 changes: 26 additions & 0 deletions docs/specs/bundled-core-vocabulary-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Bundled Core Vocabulary Workflow

bundled core 語彙の追加・補正は、都度の作業ログではなく再現可能な review/apply workflow として保守する。版管理と runtime sync の方針自体は `docs/adr/0002-bundled-core-dictionary-lifecycle.md` に従い、この spec では日常的な語彙メンテ手順だけを固定する。

## Workflow Contract

- bundled core の review/apply は `scripts/vocab/*.py` の既存 workflow を使い、手作業で TSV を再構成しない
- review 対象はその回の rank band だけに絞り、既承認の `lemma/pos` を重複反映しない
- `approved_slice_*.tsv` に入れる行は `status=approved` を守り、`meaning_ja_candidate` と `distractor_group_candidate` を目視確認する
- 承認 slice の統合は `merge_parallel_reviews.py`、bundled core への反映は `apply_review_batch.py` を使う
- `apply_review_batch.py` は既存 `lemma/pos` を再適用しないため、post-apply 監査で既存 entry を補正した場合は `approved_review_candidates.tsv` / `approved_seed.csv` だけでなく `assets/words_core.jsonl` も同期更新する
- retry や比較用の TSV は merge 対象ディレクトリへ `approved_slice*.tsv` 名で置かない。比較用ファイルが必要なら別ディレクトリへ退避する

## Review Rules

- 新規追加帯では learner-dictionary の中心義を優先し、特殊義や派生義を代表訳にしない
- verb の `meaning_ja` は述語形で監査し、名詞形の gloss を残さない
- `distractor_group` は出題時の誤答品質を基準に監査し、特に people / place / daily / abstract noun 系の drift を spot check する
- row の追加後に silent quality drift を残さないため、新規帯ごとに representative gloss と `distractor_group` の spot audit を行う

## Validation

- bundled core 更新後は `go test ./...` を実行する
- bundled core 更新後は `go build ./...` を実行する
- bundled core 更新後は `go run ./cmd/eitango validate --embedded-core` を実行する
- fresh data dir を `EITANGO_DATA_DIR` で分離し、`go run ./cmd/eitango stats` の後に `go run ./cmd/eitango doctor` を実行する
49 changes: 49 additions & 0 deletions docs/specs/session-modes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Session Modes

`eitango` は session intent (`play` / `review`) と answer mode (`choice` / `write`) を組み合わせて学習フローを構成する。この spec では、単発の実装タスクではなく継続保守で守るべき契約だけを残す。

## CLI and Persistence

- public command は `eitango play [choice|write]` と `eitango review [choice|write]` とする
- `learn` は `play` の互換 alias として残す
- answer mode を省略した場合は `choice` を既定値とする
- active session は保存済みの `answer_mode` で再開する
- legacy DB row に `answer_mode` が無い場合は `choice` として扱い、`doctor` は read-only 診断を壊さず migration drift だけを報告する

## Home Start Rules

- ホーム画面では `Tab` で `choice / write` を切り替え、`Enter` は play、`r` は review、`n` は新しい learn 開始要求として扱う
- active session が無い場合は、`Enter` / `r` / `n` は即開始する
- active session がある場合、`Enter` はホームで選択中の `answer_mode` が active session と同じときだけ再開する
- active session がある状態で `Enter` の mode が食い違う場合、または `r` / `n` で新 session を要求した場合は、開始前に abandon 確認 overlay を出す
- abandon 確認の accept は active session を `abandoned` にしてから pending request を開始し、cancel は active session とホーム上の選択 answer mode を維持する

## Write Mode Contract

- `write` は `meaning_ja` を prompt にし、`trim + lower-case + exact match` で正誤判定する
- `write` 中の通常入力を阻害しないため、hint と skip は文字キーではなく補助操作へ割り当てる
- 既定操作では `Tab` が staged hint、`Ctrl+S` が skip、`Enter` が confirm、`Esc` が離脱に使われる
- hint は初回に先頭文字を開示し、5 文字以上なら末尾文字も開示する。その後は未開示文字を中心から外側へ 1 文字ずつ開示する
- write の rating は自動決定し、hint なし正解は `Easy`、hint あり正解は `Good`、不正解と skip は `Again` とする
- write の feedback は `Enter` だけで保存して次へ進み、choice feedback のような rating shortcut は出さない
- answer を露出しすぎないため、write 中の音声再生と autoplay は prompt 画面ではなく feedback 画面だけで有効にする

## Write Difficulty

- `write_mode_difficulty` は `basic` / `hard` の 2 値だけを受け付け、未指定時は `basic` とする
- `basic` は `mode=learn` かつ `answer_mode=write` の新規候補だけに作用し、Choice で一度見た語 (`reviews.answer_mode = 'choice'`) から出題する
- `basic` の候補は due 除外を維持し、通常の新規語と同じ順序で扱う
- `basic` は候補不足時に fallback 補完しない
- `hard` は従来どおり通常の新規語候補を使う
- write difficulty の設定面はホーム設定または `config.toml` とし、CLI flag による一時 override は持たない

## Review Fallback

- review 開始時は、まず due 語だけを対象にする
- due 語が 0 件で、かつ review 履歴が 1 件以上ある語が存在する場合は、即エラーではなく reviewed-only fallback 確認を返す
- reviewed-only fallback は過去に出題済み語だけをランダム出題する review practice として扱う
- fallback session は通常 review と別 mode として保持し、active session 再開後も reviewed-only practice であることを失わない
- fallback session の回答は `progress` / `due_at` / interval など SRS 状態を更新しない
- fallback session の choice / write feedback は `Enter` だけで次へ進み、rating は保存しない
- due 語も review 履歴も無い場合だけ、従来どおり `no words available for this session` を返す
- startup の `eitango review [choice|write]` 経路でも同じ fallback 確認を使う
2 changes: 1 addition & 1 deletion internal/dict/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
projectassets "github.com/harumiWeb/eitango/assets"
)

const CoreWordsVersion = "2026-04-11-leipzig-wnjpn-core-8k-v16"
const CoreWordsVersion = "2026-04-20-leipzig-wnjpn-core-10k-v17"

func LoadCoreWords() ([]Entry, error) {
file, err := projectassets.Embedded.Open("words_core.jsonl")
Expand Down
Loading
Loading