Skip to content

Commit 6badbbd

Browse files
committed
1 parent dbe39fd commit 6badbbd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

autocorrect/src/lib.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ lazy_static! {
124124
Strategery::new(r"\p{CJK}", r"[\|+]", true, true),
125125
// @ after CJK, not not before, 你好 @某某
126126
Strategery::new(r"\p{CJK}", r"[@]", true, false),
127-
Strategery::new(r"\p{CJK}", r"[\[\(‘“]", true, false),
128-
Strategery::new(r"[’”\]\)!]", r"\p{CJK}", true, false),
127+
Strategery::new(r"\p{CJK}", r"[\[\(]", true, false),
128+
Strategery::new(r"[\]\)!]", r"\p{CJK}", true, false),
129129

130130
// FullwidthPunctuation remove space case, Fullwidth can safe to remove spaces
131131
Strategery::new(r"[\w\p{CJK}]", r"[,。!?:;)」》】”’]", false, true),
@@ -248,7 +248,9 @@ mod tests {
248248
"发现macOS安装软件新方法:Homebrew" => "发现 macOS 安装软件新方法:Homebrew",
249249
"without looking like it’s been marked up with tags or formatting instructions." => "without looking like it’s been marked up with tags or formatting instructions.",
250250
"隔夜SHIBOR报1.5530%,上涨33.80%个基点。7天SHIBOR报2.3200%,上涨6.10个基点。3个月SHIBOR报2.8810%,下降1.80个" => "隔夜 SHIBOR 报 1.5530%,上涨 33.80% 个基点。7 天 SHIBOR 报 2.3200%,上涨 6.10 个基点。3 个月 SHIBOR 报 2.8810%,下降 1.80 个",
251-
"野村:重申吉利汽车(00175)“买入”评级 上调目标价至17.9港元" => "野村:重申吉利汽车 (00175)“买入” 评级 上调目标价至 17.9 港元",
251+
// https://support.apple.com/zh-cn/iphone-12-and-iphone-12-pro-service-program-for-no-sound-issues
252+
"适用于“无声音”问题的iPhone 12和iPhone 12 Pro服务计划" => "适用于“无声音”问题的 iPhone 12 和 iPhone 12 Pro 服务计划",
253+
"野村:重申吉利汽车(00175)“买入”评级 上调目标价至17.9港元" => "野村:重申吉利汽车 (00175)“买入”评级 上调目标价至 17.9 港元",
252254
"小米集团-W调整目标价为13.5港币" => "小米集团-W 调整目标价为 13.5 港币",
253255
"(路透社)-预计全年净亏损约1.3亿港元*预期因出售汽车" => "(路透社)- 预计全年净亏损约 1.3 亿港元*预期因出售汽车",
254256
"(路透社)-预计全年净亏损约1.3亿\n\n港元*预期因出售汽车" => "(路透社)- 预计全年净亏损约 1.3 亿\n\n港元*预期因出售汽车",
@@ -357,8 +359,8 @@ mod tests {
357359
"【腾讯】-发布-【新版】本微信" => "【腾讯】- 发布 -【新版】本微信",
358360
"「腾讯」-发布-「新版」本微信" => "「腾讯」- 发布 -「新版」本微信",
359361
"《腾讯》-发布-《新版》本微信" => "《腾讯》- 发布 -《新版》本微信",
360-
"“腾讯”-发布-“新版”本微信" => "“腾讯” - 发布 - “新版” 本微信",
361-
"‘腾讯’-发布-‘新版’本微信" => "‘腾讯’ - 发布 - ‘新版’ 本微信"
362+
"“腾讯”-发布-“新版”本微信" => "“腾讯” - 发布 - “新版”本微信",
363+
"‘腾讯’-发布-‘新版’本微信" => "‘腾讯’ - 发布 - ‘新版’本微信"
362364
];
363365

364366
assert_cases(cases);

0 commit comments

Comments
 (0)