dedash

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Remove em-dashes and the dashes standing in for them from the scope the user names, one occurrence at a time, while leaving hyphens, ranges, and deliberate marks alone.
在用户指定的范围内,逐一移除长破折号(em-dash)及其替代符号,同时保留连字符、范围符号和刻意使用的标记。

Goal

目标

Replace each em-dash that should not remain with the mark or wording its clause actually needs. Target any dash doing an em-dash's job, whatever its exact character: U+2014 and its longer or repurposed look-alikes all read the same on the page. The user owns the scope: a passage, field, file, selection, or tree. Do not widen it without asking.
将每一处不应保留的长破折号替换为其所在分句实际需要的标记或措辞。针对所有起到长破折号作用的符号,无论其具体字符是什么:U+2014以及更长或被替代的相似符号在页面上的视觉效果一致,均需处理。用户拥有范围的决定权:可以是一段文本、一个字段、一个文件、选中内容或目录树。未经询问,请勿扩大处理范围。

Workflow

工作流程

  1. FIND: Take the exact scope from the user and locate every dash doing an em-dash's job in it, judged by the role it plays in the sentence, not its codepoint: any mark that sets off an aside, an appositive, an abrupt turn, or a missing conjunction. The em-dash (U+2014) is the common one; the horizontal bar (U+2015) and the two- and three-em dashes (U+2E3A, U+2E3B) read the same and count. The en-dash (U+2013) is the boundary case: it counts when it joins clauses where an em-dash would fit, but stays when it spans a range's endpoints, numeric or not (
    1990–2020
    , the
    London–Paris
    route). A dash doing a non-em job (a hyphen, a minus, a range) stays. Surface anything genuinely ambiguous as a judgment call rather than changing it blindly.
  2. REPLACE per role: Choose per occurrence by grammatical role:
    • Parenthetical aside: commas or parentheses when the dashed material can be lifted out of the sentence.
    • Appositive: a colon or comma when the dashed material renames, defines, or expands the noun before it.
    • Abrupt turn: a full stop, semicolon, or comma when the dash marks a pivot, interruption, or restart.
    • False-conjunction break: rewrite the sentence when the dash stands in for a missing "and", "but", "because", "so", or another real connective.
  3. LEAVE-ALONE: Unless the user explicitly includes them and the context proves them wrong, leave untouched:
    • hyphenated compounds, minus signs, and negative numbers
    • ranges such as
      1-10
      ,
      1–10
      , or
      London–Paris
      ; a range dash is not an em-dash
    • code, diffs, command output, identifiers, serialized data, URLs, paths, anchors, and query strings
    • quoted or clearly deliberate em-dashes in stylized prose; these surface as judgment calls, never as blind mutations
  4. RE-READ: Read every changed sentence in place. Fix awkward rhythm, dangling punctuation, doubled spaces, and connector loss introduced by the replacement. If the sentence now needs wording instead of punctuation, rewrite the smallest clause that solves it.
  5. REPORT: State the scope checked, how many dashes were found and changed, which replacements were used by role, and anything left alone or surfaced as a judgment call.
  1. 查找:获取用户指定的精确范围,定位其中所有起到长破折号作用的符号——判断依据是其在句子中的作用,而非编码点:任何用于分隔插入语、同位语、语义突变或替代缺失连词的标记都属于此类。长破折号(U+2014)是最常见的;水平杠(U+2015)以及双长、三长破折号(U+2E3A、U+2E3B)视觉效果一致,也需纳入处理。短破折号(U+2013)属于边界情况:当它用于连接适合使用长破折号的分句时需要处理,但当它用于表示范围(如
    1990–2020
    London–Paris
    航线)时则保留。起到非长破折号作用的符号(连字符、减号、范围符号)均保留。对于确实存在歧义的情况,需提出判断建议,而非盲目修改。
  2. 按作用替换:根据每一处符号的语法作用选择替换方式:
    • 插入语:若被破折号分隔的内容可从句子中移除,使用逗号或括号替换。
    • 同位语:若被破折号分隔的内容用于重命名、定义或扩展前文名词,使用冒号或逗号替换。
    • 语义突变:若破折号表示语义转折、中断或话题重启,使用句号、分号或逗号替换。
    • 替代连词缺失:若破折号替代了缺失的“and”“but”“because”“so”或其他真实连词,需改写句子。
  3. 保留内容:除非用户明确要求处理且上下文证明需要修改,否则以下内容均保持不变:
    • 连字符构成的复合词、减号和负数
    • 范围符号,如
      1-10
      1–10
      London–Paris
      ;范围符号不属于长破折号
    • 代码、差异文件、命令输出、标识符、序列化数据、URL、路径、锚点和查询字符串
    • 风格化散文中被引用或明确刻意使用的长破折号;此类情况需提出判断建议,而非盲目修改
  4. 重读检查:在原语境中重读每一处修改后的句子。修正替换后出现的节奏生硬、标点悬垂、空格重复或连接词缺失问题。若句子现在需要调整措辞而非标点,仅修改最小分句以解决问题。
  5. 报告:说明检查的范围、发现并修改的破折号数量、按作用分类的替换方式,以及所有保留内容或提出判断建议的情况。

Rules

规则

  • Never do blanket replacement. The same glyph can require different punctuation in different clauses.
  • Never replace an em-dash with a hyphen as the cleanup.
  • Mutate with edit-safety: edit unicode-safe (
    PYTHONUTF8=1
    ) and replace each dash per occurrence, never a blanket sweep; if the scope contains no such dash, report a MISS rather than changing nearby punctuation.
  • Preserve the user's voice. This skill removes a mark where requested; it does not flatten style outside the user-owned scope.
  • 禁止批量替换。相同符号在不同分句中可能需要不同的标点替换。
  • 清理时禁止将长破折号替换为连字符。
  • 安全编辑:采用Unicode安全编辑模式(
    PYTHONUTF8=1
    ),逐处替换破折号,绝不批量处理;若范围内无此类破折号,需报告未找到,而非修改附近标点。
  • 保留用户的语气风格。本技能仅按要求移除指定标记,不会改变用户指定范围外的文本风格。

Verification

验证

Before finishing, confirm:
  1. The scope stayed exactly user-owned.
  2. Every replacement was selected per occurrence by grammatical role.
  3. Leave-alone cases stayed untouched or were reported as judgment calls.
  4. The report includes counts and any judgment calls.
完成处理前,确认:
  1. 处理范围严格遵循用户指定的范围。
  2. 每一处替换均根据其语法作用逐处选择。
  3. 需保留的内容均未被修改,或已作为判断建议提出。
  4. 报告包含修改数量及所有判断建议。