实战范例:改善写作
这份范例演示如何使用 yaku 的润色模式,写出更清晰、更自然的文字——尤其是你正在学习的语言。
润色英文 email 草稿
Section titled “润色英文 email 草稿”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 an issue we found during testing.搭配语气控制
Section titled “搭配语气控制”使用 --context 设置正式程度:
# 给英文客户的正式 emailecho "We found a bug and will fix it soon" | \ yaku --mode polish --to en --context "formal email to enterprise client"# We have identified an issue and are working on a resolution. We will update you shortly.
# 日文的轻松 Slack 消息echo "CIまた壊れた、誰か見てくれない?" | \ yaku --mode polish --to ja --context "casual Slack message"# CIがまた壊れました — 誰か確認してもらえますか?润色 PR 描述
Section titled “润色 PR 描述”当你要对英文项目发 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 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.yaku --mode polish --to en -f draft-blog-post.md -o polished-blog-post.md对于 Markdown 文件,yaku 会保留结构(标题、代码块、链接),只润色文字部分。
润色中文文字
Section titled “润色中文文字”润色模式也适用于中文——用在重要的沟通场合很有帮助:
echo "这个部署会延迟因为我们在测试发现了一个问题" | \ yaku --mode polish --to zh-CN输出:
此次部署将会延迟,因为我们在测试中发现了一个问题。工作流程:先用中文写,再翻译
Section titled “工作流程:先用中文写,再翻译”如果你需要用正在学习的语言写作,可以先用中文写好,再让 yaku 翻译并带上上下文:
echo "我们需要在下个 sprint 修这个 bug,不然会影响用户体验" | \ yaku --to en --context "team status update"--context 选项可以在一个步骤中调整语气和正式程度——不需要先翻译再润色。
- 不要过度润色。 如果原文已经很清楚,yaku 只会做最小幅度的修改。
- 用
--context配合对象。 Slack 消息和客户 email 需要不同的正式程度。 - 检查输出。 润色模式会让文字更自然,但请确认它仍然表达了你的原意。