レシピ: 文章の改善
このレシピでは、yakuの推敲モードを使って、より明確で自然なテキストを書く方法を紹介します。特にまだ学習中の言語で書くときに便利です。
英語のメール下書きを推敲
Section titled “英語のメール下書きを推敲”echo "I want to inform you that the deployment will be delay because of the issue we found in testing." | \ yaku --mode polish --to en出力:
I'd like to inform you that the deployment will be delayed due to the issue we found during testing.トーンを調整して推敲
Section titled “トーンを調整して推敲”--contextで敬語レベルを設定します:
# 英語で書くフォーマルなクライアント向けメールecho "We found a bug and we will fix it soon" | \ yaku --mode polish --to en --context "formal email to enterprise client"# We have identified an issue and are actively working on a resolution. We will provide an update shortly.
# フランス語のカジュアルなSlackメッセージecho "le CI est cassé encore, quelqu'un peut regarder?" | \ yaku --mode polish --to fr --context "casual Slack message"# Le CI est encore cassé — quelqu'un peut jeter un œil ?PR説明文の推敲
Section titled “PR説明文の推敲”他の言語のプロジェクトに貢献するとき:
cat <<'EOF' | yaku --mode polish --to en --context "GitHub pull request description"This PR fix the issue where user input is not validate before send to API.Also add test for the new validation logic.EOF出力:
This PR fixes the issue where user input is not validated before being sent to the API.It also adds tests for the new validation logic.ファイルを推敲
Section titled “ファイルを推敲”yaku --mode polish --to en -f draft-blog-post.md -o polished-blog-post.mdMarkdownファイルの場合、yakuは構造(見出し、コードブロック、リンク)を保持しながら散文を推敲します。
中国語テキストの推敲
Section titled “中国語テキストの推敲”推敲モードは中国語でも動作します — 学習中の方に便利:
echo "我想要告诉你关于那个服务器的问题,它昨天又坏了" | \ yaku --mode polish --to zh-CN出力:
我想告诉你服务器的问题,它昨天又出故障了。ワークフロー:母語で書いてから翻訳
Section titled “ワークフロー:母語で書いてから翻訳”学習中の言語で書く必要がある場合、まず母語で書いてからyakuで翻訳し、コンテキストを付与します:
echo "次のスプリントでこのバグを修正する必要があります。さもないとユーザー体験に影響します" | \ yaku --to en --context "team status update"--contextオプションが1ステップでトーンと敬語レベルを調整します — 翻訳してから推敲する必要はありません。
- 推敲しすぎない。 元のテキストがすでに明確なら、yakuは最小限の変更で返します。
--contextで読者に合わせる。 Slackメッセージとクライアント向けメールでは異なる敬語レベルが必要です。- 出力を確認する。 推敲モードはテキストをより自然にしますが、意図した内容が保たれているか確認してください。