Skip to content

Commit

Permalink
feat: move filters of opencc.py to tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
outloudvi committed Feb 17, 2021
1 parent 79426d8 commit 97bc191
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions mw2fcitx/exporters/opencc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion mw2fcitx/tweaks/moegirl.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ def tweak_normalize(words):
[":", "/", "(", ")", "(", ")", "【", "】", "『", "』", "/"]),
tweak_len_more_than(1),
tweak_remove_char("·"),
tweak_trim_suffix(["系列"]),
tweak_trim_suffix(["系列", "列表", "对照表"]),
tweak_normalize
]

0 comments on commit 97bc191

Please sign in to comment.