From 9944f795e191fb3606d65ada84b6fad5665f8776 Mon Sep 17 00:00:00 2001 From: mozillazg Date: Fri, 19 Aug 2016 21:01:36 +0800 Subject: [PATCH] pinyin.txt add line comments --- CHANGELOG.md | 1 + README.md | 6 +++++- merge_unihan.py | 2 ++ pinyin.txt | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4b3714..01f1361 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Fix some pinyin: 罗 via [468ffaa8](https://github.com/mozillazg/pinyin-data/commit/468ffaa8eb678637c7565a02e6836255bd0df06c) . * Support Chinese that in PUA([Private Use Area](https://en.wikipedia.org/wiki/Private_Use_Areas>)) via [#2](https://github.com/mozillazg/pinyin-data/pull/2). +* pinyin.txt add line comments that startswith `#`. ## 0.2.0 (2016-07-19): diff --git a/README.md b/README.md index 02b60e6..b8d7050 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,11 @@ ## 数据介绍 -数据格式:`{code point}: {pinyins} # {hanzi}` (示例:`U+4E2D: zhōng,zhòng # 中`) +数据格式: + +* 格式:`{code point}: {pinyins} # {hanzi}` (示例:`U+4E2D: zhōng,zhòng # 中`) +* 以 `#` 开头的行是注释 + [Unihan Database][unihan] 数据版本: > Date: 2016-06-01 07:01:48 GMT [JHJ] diff --git a/merge_unihan.py b/merge_unihan.py index 5e296c8..6bcd01d 100644 --- a/merge_unihan.py +++ b/merge_unihan.py @@ -93,4 +93,6 @@ def extend_pinyins(old_map, new_map, only_no_exists=False): assert set(overwrite_pinyin_map.keys()) - code_set == set() assert set(pua_pinyin_map.keys()) - code_set == set() with open('pinyin.txt', 'w') as fp: + fp.write('# version: 0.3.0\n') + fp.write('# source: https://github.com/mozillazg/pinyin-data\n') save_data(new_pinyin_map, fp) diff --git a/pinyin.txt b/pinyin.txt index 65e8702..ccc9bd4 100644 --- a/pinyin.txt +++ b/pinyin.txt @@ -1,3 +1,5 @@ +# version: 0.3.0 +# source: https://github.com/mozillazg/pinyin-data U+3007: líng # 〇 U+3400: qiū # 㐀 U+3401: tiàn # 㐁