Skip to content

PunctuationFixer

neavo edited this page Dec 5, 2024 · 2 revisions

功能描述

  • 本插件的主要功能是通过对原文和译文中标点的比对
  • 来修复那些在翻译过程中被错误的转换的了标点
  • 目前可以修复的标点包括:
CHECK_ITEMS = (
    (":", ":"),
    (":", ":"),
    ("·", "・"),
    ("・", "·"),
    ("?", "?"),
    ("?", "?"),
    ("!", "!"),
    ("!", "!"),
    ("\u002d", "\u2014", "\u2015"),                    # 破折号之间的转换,\u002d = - ,\u2014 = ― ,\u2015 = —
    ("\u2014", "\u002d", "\u2015"),                    # 破折号之间的转换,\u002d = - ,\u2014 = ― ,\u2015 = —
    ("\u2015", "\u002d", "\u2014"),                    # 破折号之间的转换,\u002d = - ,\u2014 = ― ,\u2015 = —
    ("「", "‘", "“", "『"),
    ("」", "’", "”", "』"),
    ("『", "‘", "“", "「"),
    ("』", "’", "”", "」"),
    ("(", "(", "「", "‘", "“"),
    (")", ")", "」", "’", "”"),
    ("(", "(", "「", "‘", "“"),
    (")", ")", "」", "’", "”"),
)

REPLACE_ITEMS = (
    ("「", "‘", "“"),
    ("」", "’", "”"),
)

CIRCLED_NUMBERS_ALL = (①, ...,㊿)
Clone this wiki locally