diff --git a/Makefile b/Makefile index b83de19..413cdcc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=20201220 +VERSION=20210101 FILENAME=zhwiki-$(VERSION)-all-titles-in-ns0 all: build diff --git a/convert.py b/convert.py index 4d2b198..5509d9c 100755 --- a/convert.py +++ b/convert.py @@ -23,6 +23,10 @@ _HANZI_RE = re.compile('^[\u4e00-\u9fa5]+$') _TO_SIMPLIFIED_CHINESE = opencc.OpenCC('t2s.json') +_PINYIN_FIXES = { + 'n': 'en', # https://github.com/felixonmars/fcitx5-pinyin-zhwiki/issues/13 +} + logging.basicConfig(level=logging.INFO) @@ -61,7 +65,8 @@ def main(): for line in f: title = _TO_SIMPLIFIED_CHINESE.convert(line.strip()) if is_good_title(title, previous_title): - pinyin = _PINYIN_SEPARATOR.join(lazy_pinyin(title)) + pinyin = [_PINYIN_FIXES.get(item, item) for item in lazy_pinyin(title)] + pinyin = _PINYIN_SEPARATOR.join(pinyin) if pinyin == title: logging.info( f'Failed to convert to Pinyin. Ignoring: {pinyin}') diff --git a/recipe.yaml b/recipe.yaml index 0295070..2716d67 100644 --- a/recipe.yaml +++ b/recipe.yaml @@ -5,6 +5,6 @@ recipe: description: >- Install zhwiki dict from fcitx5-pinyin-zhwiki download_files: >- - zhwiki.dict.yaml::https://github.com/felixonmars/fcitx5-pinyin-zhwiki/releases/download/0.2.1/zhwiki-20201220.dict.yaml + zhwiki.dict.yaml::https://github.com/felixonmars/fcitx5-pinyin-zhwiki/releases/download/0.2.1/zhwiki-20210101.dict.yaml install_files: >- zhwiki.dict.yaml