diff options
| author | Sho Sakuma <me@m1sk9.dev> | 2026-01-11 18:27:53 +0900 |
|---|---|---|
| committer | Sho Sakuma <me@m1sk9.dev> | 2026-01-11 18:49:01 +0900 |
| commit | a7c47276162f40e7e3fa673c4afbc74e52d8c6ee (patch) | |
| tree | 3d7854a0b6ca9800e475cc9577149475875c57ae /docs/src/guide | |
| parent | ca9bfd0b0f572c889837bedd41ef4eac76fdb558 (diff) | |
| download | LunaticChat-a7c47276162f40e7e3fa673c4afbc74e52d8c6ee.tar.gz LunaticChat-a7c47276162f40e7e3fa673c4afbc74e52d8c6ee.tar.bz2 LunaticChat-a7c47276162f40e7e3fa673c4afbc74e52d8c6ee.zip | |
docs: Update docs
Diffstat (limited to 'docs/src/guide')
| -rw-r--r-- | docs/src/guide/configuration.md | 26 | ||||
| -rw-r--r-- | docs/src/guide/getting-started.md | 2 | ||||
| -rw-r--r-- | docs/src/guide/japanese-romanization.md | 61 |
3 files changed, 76 insertions, 13 deletions
diff --git a/docs/src/guide/configuration.md b/docs/src/guide/configuration.md index b1d606a..14177b4 100644 --- a/docs/src/guide/configuration.md +++ b/docs/src/guide/configuration.md @@ -12,11 +12,14 @@ # Please specify appropriate values to ensure LunaticChat functions correctly. # # For detailed configuration options, please refer to the documentation: -# https://lc.m1sk9.dev/guide//configuration +# https://lc.m1sk9.dev/guide/configuration # ---------------------------------------------- # If enabled, Activate LunaticChat's debug mode, which provides detailed logging for troubleshooting. -debug: false +debug: true + +# Path to the YAML file storing player settings +userSettingsFilePath: "player-settings.yaml" # ---------------------------------------------- # ----------- Features Settings ------------ @@ -28,7 +31,7 @@ features: enabled: true japaneseConversion: # If enabled, enables the conversion function from Roman letters to hiragana. - enabled: false + enabled: true cache: maxEntries: 500 saveIntervalSeconds: 300 @@ -36,8 +39,6 @@ features: api: timeout: 3000 retryAttempts: 2 - settings: - directory: "settings" # ---------------------------------------------- # --------- Message Format Settings -------- @@ -47,6 +48,7 @@ features: # You can use placeholders such as {sender}, {message}, etc. # # {sender} - The name of the message sender +# {recipient} - The name of the message recipient # {message} - The content of the message # ---------------------------------------------- @@ -64,6 +66,13 @@ messageFormat: LunaticChat をデバッグモードで起動します. +### `userSettingsFilePath` + +- Type: `string` +- Default: `player-settings.yaml` + +LunaticChat がプレイヤーの設定を保存する YAML ファイルのパスを指定します. + ## Features Settings ### `features.quickReplies.enabled` @@ -125,13 +134,6 @@ LunaticChat の [`/reply`](../reference/commands/reply.md) コマンドによる ローマ字変換 API へのリクエストが失敗した場合の再試行回数を指定します. -#### `settings.directory` - -- Type: `string` -- Default: `settings` - -ローマ字変換のユーザーごとの設定ファイルを保存するディレクトリを指定します. - ## Message Format Settings 使用できるプレースホルダー: diff --git a/docs/src/guide/getting-started.md b/docs/src/guide/getting-started.md index db922f6..85fbf31 100644 --- a/docs/src/guide/getting-started.md +++ b/docs/src/guide/getting-started.md @@ -14,7 +14,7 @@ LunaticChat を起動すると以下のファイルが作成されます. - `plugins/LunaticChat/config.yml`:プラグインの設定ファイル -- `plugins/LunaticChat/settings/`:ユーザーごとの設定ファイルが保存されるフォルダ +- `plugins/LunaticChat/player-settings.yaml`:ユーザーごとの設定ファイル - `plugins/LunaticChat/conversion_cache.json`: ローマ字変換のキャッシュファイル 設定ファイル `config.yml` を開き,必要に応じて設定を変更します.設定項目の詳細については,[設定ガイド](./configuration.md)を参照してください. diff --git a/docs/src/guide/japanese-romanization.md b/docs/src/guide/japanese-romanization.md new file mode 100644 index 0000000..3e9d702 --- /dev/null +++ b/docs/src/guide/japanese-romanization.md @@ -0,0 +1,61 @@ +# ローマ字変換 + +LunaticChat では、日本語のテキストをローマ字に変換する機能が提供されています. + +## 設定を有効化する + +ローマ字変換機能を有効にするには `features.japaneseConversion.enabled` の値を `true` にする必要があります. + +```yaml{4} +features: + # ... + japaneseConversion: + enabled: true +``` + +## 変換の仕組み + +LunaticChat はプレイヤーからのテキストを以下の手順で変換を行います. + +1. プレイヤーからのテキストがローマ字で構成されているかを検証する +2. メモリキャッシュから該当のフレーズがあるかどうかを調べる + 1. ここで該当フレーズがヒットした場合はそれをサーバーに返す +3. メモリキャッシュに存在していない場合は,ローマ字からひらがなに変換する +4. 変換した文字列を Google IME API へ送り,人が読める形に変換する +5. メモリキャッシュに保存し,それをサーバーに返す + +``` +┌───────────────────────────────────────────────────┐ +│ User Input │ +│ (Romanji Text) │ +└─────────────────────┬─────────────────────────────┘ + │ + ▼ +┌───────────────────────────────────────────────────┐ +│ RomanjiConverter │ +│ ┌───────────────────────────────────────────┐ │ +│ │ 1. Check Memory Cache │ │ +│ │ └─→ Hit: Return immediately │ │ +│ │ │ │ +│ │ 2. Call Google IME API │ │ +│ │ │ │ +│ │ 3. Store in Memory Cache │ │ +│ │ │ │ +│ │ 4. Queue for Disk Save (async) │ │ +│ └───────────────────────────────────────────┘ │ +└─────────────────────┬─────────────────────────────┘ + │ + ▼ +┌───────────────────────────────────────────────────┐ +│ Converted Text │ +│ (Japanese Text) │ +└───────────────────────────────────────────────────┘ +``` + +::: tip ファイルへの保存 + +メモリキャッシュの内容は負荷にならないよう,設定した秒毎にファイルキャッシュへ自動でセーブします. + +::: + +## |
