From 3eb0440b58d28804ba9f89026518671fd7630046 Mon Sep 17 00:00:00 2001 From: "Chen, Chien-ting" Date: Sat, 14 Aug 2021 21:42:26 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=A7=81->=E6=88=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- pseudo-chinese.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0874d1e..091aa53 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This tool will automatically generate fake Chinese from Japanese sentences. Using MeCab to parse and word-tag Japanese sentences instead of COTOHA API. ## Demo -私は本日定時退社します -> 我本日定時退社為 +私は本日定時退社します -> 我本日定時退社 私はお酒を飲みたい -> 我御酒飲欲 diff --git a/pseudo-chinese.py b/pseudo-chinese.py index 35415e2..3146cb0 100644 --- a/pseudo-chinese.py +++ b/pseudo-chinese.py @@ -69,8 +69,6 @@ if __name__ == "__main__": prime = token["lemma"] - if token['lemma'] == '私-代名詞': - prime = '我' if (token['lemma'] == '君' or token['lemma'] == '貴方' or token['lemma'] == 'お前'): prime = '你' @@ -83,6 +81,9 @@ if __name__ == "__main__": if compound_matched: prime = compound_matched.group(1) + if token['lemma'] == '私-代名詞': + prime = '我' + if len(token["features"]) != 0: if "連体形-一般" in token['features']: if token['lemma'] == 'ない':