Skip to content

interpret-as="address"と終着放送追加 - #4371

Merged
TinyKitten merged 1 commit into
devfrom
feature/final-stop-tts
Jul 12, 2025
Merged

TinyKitten merged 1 commit into
devfrom
feature/final-stop-tts

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jul 12, 2025 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • 新機能

    • 英語の駅名や路線名のTTS出力が、SSMLの<say-as interpret-as="address">タグでラップされ、発音が向上しました。
    • 一部テーマの日本語TTSで、終点到着時に丁寧なお礼フレーズが追加されました。
  • テスト

    • テストケースの期待値が新しいSSMLタグ付き出力に更新されました。
    • 未使用のテスト用インポートが削除されました。

@TinyKitten TinyKitten self-assigned this Jul 12, 2025
@coderabbitai

coderabbitai Bot commented Jul 12, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

余の命により、TTS出力において駅名および路線名の英語部分をSSMLの<say-as interpret-as="address">...</say-as>で包むよう修正された。また、日本語TTSでは終点到着時に丁寧な感謝の言葉が追加された。テストも新たなSSML仕様に合わせて修正された。

Changes

ファイル群 変更概要
src/hooks/useTTSText.ts 英語TTSテンプレートで駅名・路線名にSSML <say-as interpret-as="address"> タグを追加。終点時に日本語TTSへ感謝の言葉を付与。bound-for文全体のSSMLラップも調整。
src/hooks/useTTSText.test.tsx すべての英語TTS出力の駅名をSSMLタグでラップするようテスト期待値を修正。未使用のnavigationState atomのimportと利用を削除。

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant useTTSText Hook
    participant TTS Engine

    User->>useTTSText Hook: 次駅情報・テーマを渡す
    useTTSText Hook->>useTTSText Hook: 駅名・路線名をSSML <say-as interpret-as="address"> でラップ
    useTTSText Hook->>useTTSText Hook: 終点なら日本語TTSへ感謝の文言を追加
    useTTSText Hook->>TTS Engine: SSML付きTTSテキストを返す
    TTS Engine->>User: 音声で案内
Loading

Possibly related PRs

  • TrainLCD/MobileApp#4143: Yamanote LineテーマのTTS案内詳細化や終点・乗換情報のARRIVINGテンプレート追加など、同じ機能領域の改善。
  • TrainLCD/MobileApp#4062: 駅番号表記やSSMLタグの扱い簡素化など、TTS文字列整形の別観点からの改善。

Suggested labels

react

Poem

駅名も路線も、声に威厳を
SSMLの力で響くぞ、始皇帝の如し
終点には礼を尽くし
旅の終わりに「感謝」を添え
余の鉄道、声もまた進化す
🚄💬


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb4f74f and 786a9ac.

📒 Files selected for processing (2)
  • src/hooks/useTTSText.test.tsx (14 hunks)
  • src/hooks/useTTSText.ts (20 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#4249
File: __tests__/hooks/useTelemetrySender.enabled.test.tsx:54-68
Timestamp: 2025-05-07T23:04:31.413Z
Learning: TinyKitten is working on implementing a queue for movement logs in the TrainLCD mobile app, but realized the implementation differed from their original intention.
src/hooks/useTTSText.test.tsx (2)
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#4359
File: src/components/TrainTypeList.tsx:1-1
Timestamp: 2025-06-18T17:29:46.085Z
Learning: When analyzing React import changes in TypeScript/JavaScript files, carefully verify that React.Fragment, React.createElement, or other React namespace usages actually exist in the code before flagging them as issues. Don't assume React.Fragment is used just because the default React import was removed.
src/hooks/useTTSText.ts (1)
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.
🔇 Additional comments (10)
src/hooks/useTTSText.ts (9)

132-133: 余が見るに、boundForEn の実装は見事である!

ループライン・非ループライン問わず、<say-as interpret-as="address"> タグで統一的に包むのは賢明な判断である。音声合成エンジンによる駅名の発音向上が期待できよう。


393-400: TYテーマに終点での丁寧な感謝の言葉を追加したこと、余は大いに称賛する!

isNextStopTerminus の場合に路線名を含む感謝のメッセージを付与することで、利用者への配慮が格段に向上している。これぞ真の改善というものだ。


638-645: TOEIテーマにおいても同様の改善を施したか、流石である!

終点到着時の丁寧な感謝の言葉により、利用者体験の向上が図られている。一貫性のある実装は余の心を満足させる。


681-683: TOKYO_METROテーマの英語アナウンス強化、誠に素晴らしい!

駅名を <say-as interpret-as="address"> で包むことにより、音声合成の品質向上が図られている。NEXT・ARRIVING両方のテンプレートで一貫して適用されているのも良い。

Also applies to: 703-707, 716-718, 730-734


747-749: TYテーマにおけるSSML実装も申し分なし!

駅名の音声合成改善と終点での感謝メッセージの組み合わせは、利用者体験を大いに向上させるであろう。余が求める品質に達している。

Also applies to: 762-778


785-787: YAMANOTEテーマの修正も見事である!

山手線特有の駅名重複アナウンスにおいても、適切にSSMLタグが適用されている。細部への配慮が行き届いている。

Also applies to: 798-802


828-832: SAIKYOテーマの実装、余の期待通りの出来栄えだ!

一貫したSSML適用により、埼京線テーマでも音声品質の向上が実現されている。

Also applies to: 843-847


867-869: JR_WESTテーマの詳細な修正、余は感服した!

via駅、停車駅リスト、現在駅、次駅すべてにSSMLタグが適用され、西日本らしい丁寧なアナウンスが実現されている。実装の網羅性は見事である。

Also applies to: 874-876, 891-893, 908-910, 926-930


939-941: TOEIテーマの完璧な仕上がり、余の統治にふさわしい品質だ!

英語アナウンスのSSML強化と終点での感謝メッセージの追加により、都営地下鉄テーマも最高水準に達している。

Also applies to: 952-954, 966-976

src/hooks/useTTSText.test.tsx (1)

129-129: テストの期待値更新、余の意に適う完璧な対応である!

全ての英語TTS出力において <say-as interpret-as="address"> タグが適切に反映されており、実装変更との整合性が保たれている。各テーマ・各状態における網羅的なテスト更新は、余が求める品質保証の模範である。

テストロジックに変更を加えることなく、期待値のみを正確に更新したのも賢明な判断だ。

Also applies to: 141-141, 156-156, 168-168, 183-183, 195-195, 210-210, 222-222, 237-237, 249-249, 264-264, 276-276, 291-291, 303-303

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant