-
-
Notifications
You must be signed in to change notification settings - Fork 143
文中にある感情タグを読み上げてしまう不具合修正 #240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthroughこのプルリクエストでは、 Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
src/features/chat/handlers.ts (1)
70-70: 正規表現の修正が適切に実装されています感情タグを文章の区切りとして認識する
(?=\[)の追加により、タグが読み上げられてしまう問題が解決されています。将来的な保守性を考慮して、以下の改善を提案します:
-/^(.{1,19}?(?:[。..!?!?\n]|(?=\[))|.{20,}?(?:[、,。..!?!?\n]|(?=\[)))/ +const SENTENCE_BOUNDARY = /^(.{1,19}?(?:[。..!?!?\n]|(?=\[))|.{20,}?(?:[、,。..!?!?\n]|(?=\[)))/;この定数を共通で使用することで、両関数での一貫性が保証され、将来の修正も容易になります。
Also applies to: 219-219
src/features/chat/handlers.ts
Outdated
| /^(.{1,19}?[。..!?!?\n]|.{20,}?[、,。..!?!?\n])/ | ||
| /^(.{1,19}?(?:[。..!?!?\n]|(?=\[))|.{20,}?(?:[、,。..!?!?\n]|(?=\[)))/ | ||
| ) | ||
| console.log('sentenceMatch', sentenceMatch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
デバッグログの取り扱いについて
開発時のデバッグに有用なログですが、以下の点について検討が必要です:
- 本番環境での不要なログ出力
- ユーザーの会話内容が含まれる可能性があるプライバシーの懸念
以下のような改善を提案します:
-console.log('sentenceMatch', sentenceMatch)
+if (process.env.NODE_ENV === 'development') {
+ console.debug('sentenceMatch:', sentenceMatch)
+}-console.log('sentence', sentence)
+if (process.env.NODE_ENV === 'development') {
+ console.debug('sentence:', sentence)
+}Also applies to: 101-101
文中にある感情タグを読み上げてしまう不具合修正
関連
Summary by CodeRabbit
Summary by CodeRabbit
新機能
バグ修正