From b62a2c783468d12da70cffb5555d579ce2239430 Mon Sep 17 00:00:00 2001 From: k2font Date: Tue, 14 Apr 2020 20:14:30 +0900 Subject: [PATCH] Create README.md --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ pseudo-chinese.py | 4 ++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e69de29..e07ba9f 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,44 @@ +# Pseudo Chinese +Convert Japanese to pseudo-Chinese. + +## Description +This tool will automatically generate fake Chinese from Japanese sentences. + +## Demo +私は本日定時退社します -> 我本日定時退社也 +私はお酒を飲みたい -> 我飲酒希望 + +## Requirement +- Python 3.5.1 +- [COTOHA API](https://api.ce-cotoha.com/contents/index.html) + +You need to register for a COTOHA API account before you can run this tool. + +Once you have registered your COTOHA API account, you will set your Client ID and Client Secret to `env.json` . + +```json +{ + "client_id": "yourclinetid", + "client_secret": "yourclinetsecret" +} +``` + +## Usage +``` +$ python -u pseudo-chinese.py +``` + +## Contribution +1. Fork it +2. Create your feature branch (git checkout -b my-new-feature) +3. Commit your changes (git commit -am 'Add some feature') +4. Push to the branch (git push origin my-new-feature) +5. Create new Pull Request + +## Licence + +[MIT](https://github.com/tcnksm/tool/blob/master/LICENCE) + +## Author + +[Shoichiro Kono](https://github.com/k2font) \ No newline at end of file diff --git a/pseudo-chinese.py b/pseudo-chinese.py index 3eb63b9..22da95b 100644 --- a/pseudo-chinese.py +++ b/pseudo-chinese.py @@ -51,8 +51,8 @@ def parse(sentence, access_token): # ひらがなを削除する関数 # Function to delete hiragana. # 删除平假名的功能 -def hira_to_blank(strj): - return "".join(["" if ("ぁ" <= ch <= "ん") else ch for ch in strj]) +def hira_to_blank(str): + return "".join(["" if ("ぁ" <= ch <= "ん") else ch for ch in str]) if __name__ == "__main__": envjson = open('env.json', 'r')