From 97bc19191eb6afcf79fe159ae4f5a2a521facdad Mon Sep 17 00:00:00 2001 From: Outvi V Date: Wed, 17 Feb 2021 23:25:25 +0800 Subject: [PATCH] feat: move filters of opencc.py to tweaks --- mw2fcitx/exporters/opencc.py | 11 ----------- mw2fcitx/tweaks/moegirl.py | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/mw2fcitx/exporters/opencc.py b/mw2fcitx/exporters/opencc.py index 43133e7..caff161 100644 --- a/mw2fcitx/exporters/opencc.py +++ b/mw2fcitx/exporters/opencc.py @@ -16,17 +16,6 @@ def export(words): if not HANZI_RE.match(line): continue - # Skip single character & too long pages - if len(line) <= 1: - continue - - # Skip list pages - if line.endswith(('列表', '对照表')): - continue - - if last_word and len(last_word) >= 4 and line.startswith(last_word): - continue - pinyin = "'".join(lazy_pinyin(line)) if pinyin == line: # print("Failed to convert, ignoring:", pinyin, file=sys.stderr) diff --git a/mw2fcitx/tweaks/moegirl.py b/mw2fcitx/tweaks/moegirl.py index 1dde53c..763f0df 100644 --- a/mw2fcitx/tweaks/moegirl.py +++ b/mw2fcitx/tweaks/moegirl.py @@ -81,6 +81,6 @@ def tweak_normalize(words): [":", "/", "(", ")", "(", ")", "【", "】", "『", "』", "/"]), tweak_len_more_than(1), tweak_remove_char("·"), - tweak_trim_suffix(["系列"]), + tweak_trim_suffix(["系列", "列表", "对照表"]), tweak_normalize ]