basic design
This commit is contained in:
58
anki-hsk-creator/OUTPUT.tsv
Normal file
58
anki-hsk-creator/OUTPUT.tsv
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
to block, to be stuck, to be wedged, customs station, a clip, a fastener, a checkpost, Taiwan pr. [ka3] qiǎ 卡 卡
|
||||||
|
to accompany, to keep sb company, to assist, old variant of 賠|赔[pei2] péi 陪 陪
|
||||||
|
nearby; neighboring, (in the) vicinity (of); neighborhood fù jìn 附近 附近
|
||||||
|
wall (CL:面[mian4],堵[du3]), (slang) to block (a website) (usu. in the passive: 被牆|被墙[bei4 qiang2]) qiáng 墙 牆
|
||||||
|
to stick, to paste, to post (e.g. on a blog), to keep close to, to fit snugly, to subsidize, allowance (e.g. money for food or housing), sticker, classifier for sticking plaster: strip tiē 贴 貼
|
||||||
|
to advertise, a commercial, advertisement, CL:項|项[xiang4] guǎng gào 广告 廣告
|
||||||
|
to line up pái duì 排队 排隊
|
||||||
|
roughly, probably, rough, approximate, about, general idea dà gài 大概 大概
|
||||||
|
clerk, shop assistant, CL:個|个[ge4] yíng yè yuán 营业员 營業員
|
||||||
|
right; correct, towards; at; for, concerning; regarding, to treat (sb a certain way), to face, (bound form) opposite; facing; matching, to match together; to adjust, to fit; to suit, to answer; to reply, to add; to pour in (a fluid), to check; to compare, classifier: couple; pair duì 对 對
|
||||||
|
(after a verb) a bit; a little (indicating brief duration, or softening the tone, or suggesting giving sth a try), all at once; suddenly yī xià 一下 一下
|
||||||
|
passport, CL:本[ben3],個|个[ge4] hù zhào 护照 護照
|
||||||
|
to yield, to permit, to let sb do sth, to have sb do sth, to make sb (feel sad etc), by (indicates the agent in a passive clause, like 被[bei4]) ràng 让 讓
|
||||||
|
to choose, to pick, to select, to elect xuǎn 选 選
|
||||||
|
to recharge (money onto a card) chōng zhí 充值 充值
|
||||||
|
domestic, internal (to a country), civil guó nèi 国内 國內
|
||||||
|
international guó jì 国际 國際
|
||||||
|
long distance, long-distance phone call (abbr. for 長途電話|长途电话[chang2 tu2 dian4 hua4]), long-distance coach (abbr. for 長途汽車|长途汽车[chang2 tu2 qi4 che1]) cháng tú 长途 長途
|
||||||
|
to cost, to spend, fee, wasteful, expenses fèi 费 費
|
||||||
|
to download, also pr. [xia4zai4] xià zǎi 下载 下載
|
||||||
|
(computer) software ruǎn jiàn 软件 軟件
|
||||||
|
hair, Taiwan pr. [fa3] fà 发 髮
|
||||||
|
text message, SMS duǎn xìn 短信 短信
|
||||||
|
to receive, to accept, to collect, to put away, to restrain, to stop, in care of (used on address line after name) shōu 收 收
|
||||||
|
mail, post, email yóu jiàn 邮件 郵件
|
||||||
|
(after a verb, indicates coming out, completion of an action, or ability to discern or detect) chu lai 出来 出來
|
||||||
|
to take care of (a matter); to deal with (a task, procedure etc); to organize (an event), to establish; to set up; to manage; to run (an enterprise), (law) to handle; to investigate; to prosecute (a case or suspect), (bound form) office (as in 招辦|招办[zhao1 ban4], admissions office) (abbr. for 辦公室|办公室[ban4 gong1 shi4]) bàn 办 辦
|
||||||
|
(once) again, also, both... and..., and yet, (used for emphasis) anyway yòu 又 又
|
||||||
|
habit, custom, usual practice, to be used to, CL:個|个[ge4] xí guàn 习惯 習慣
|
||||||
|
automated teller machine (ATM) zì dòng qǔ kuǎn jī 自动取款机 自動取款機
|
||||||
|
to take, to get, to choose, to fetch qǔ 取 取
|
||||||
|
can, to be able to, might possibly, ability, (physics) energy néng 能 能
|
||||||
|
website wǎng zhàn 网站 網站
|
||||||
|
to be afraid, to fear, to dread, to be unable to endure, perhaps pà 怕 怕
|
||||||
|
trouble; inconvenience, inconvenient; troublesome; annoying, to bother sb; to put sb to trouble má fan 麻烦 麻煩
|
||||||
|
to pay, to hand over to, classifier for pairs or sets of things fù 付 付
|
||||||
|
method; way; technique; procedure, CL:個|个[ge4] fāng fǎ 方法 方法
|
||||||
|
battery; electric cell, CL:節|节[jie2],組|组[zu3] diàn chí 电池 電池
|
||||||
|
battery charger chōng diàn qì 充电器 充電器
|
||||||
|
express delivery kuài dì 快递 快遞
|
||||||
|
ought to; should; must yīng gāi 应该 應該
|
||||||
|
wristwatch, CL:塊|块[kuai4],隻|只[zhi1],個|个[ge4] shǒu biǎo 手表 手錶
|
||||||
|
to entrust; to place in sb's care, (bound form) to depend on; to attach oneself to; to reside temporarily, (bound form) foster (as in 寄女[ji4 nu : 3] foster daughter), to send by post; to mail jì 寄 寄
|
||||||
|
(of a period of time) long jiǔ 久 久
|
||||||
|
last year qù nián 去年 去年
|
||||||
|
client; customer kè hù 客户 客戶
|
||||||
|
to serve, service, CL:項|项[xiang4] fú wù 服务 服務
|
||||||
|
to help, to assist, to support, for sb (i.e. as a help), hired (as worker), side (of pail, boat etc), outer layer, upper (of a shoe), group, gang, clique, party, secret society bāng 帮 幫
|
||||||
|
typhoon tái 台 颱
|
||||||
|
air conditioning, air conditioner (including units that have a heating mode), CL:臺|台[tai2] kōng tiáo 空调 空調
|
||||||
|
recently, soon, nearest zuì jìn 最近 最近
|
||||||
|
strange, odd, to marvel, to be baffled qí guài 奇怪 奇怪
|
||||||
|
variant of 修[xiu1] xiū 修 脩
|
||||||
|
address, CL:個|个[ge4] dì zhǐ 地址 地址
|
||||||
|
preparation, to prepare, to intend, to be about to, reserve (fund) zhǔn bèi 准备 準備
|
||||||
|
way of handling sth; means; measure; (practical) solution to a problem, CL:條|条[tiao2],個|个[ge4] bàn fǎ 办法 辦法
|
||||||
|
to open, to show (a ticket), to turn on, to switch on dǎ kāi 打开 打開
|
||||||
|
to press, to push, to leave aside or shelve, to control, to restrain, to keep one's hand on, to check or refer to, according to, in the light of, (of an editor or author) to make a comment àn 按 按
|
||||||
|
1
anki-hsk-creator/__init__.py
Normal file
1
anki-hsk-creator/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""anki-hsk-creator"""
|
||||||
51
anki-hsk-creator/__main__.py
Normal file
51
anki-hsk-creator/__main__.py
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
## Imports
|
||||||
|
from pathlib import Path
|
||||||
|
import csv
|
||||||
|
|
||||||
|
from cedict_utils.cedict import CedictParser
|
||||||
|
from pinyin_tone_converter.pinyin_tone_converter import PinyinToneConverter
|
||||||
|
# from genanki import Deck, Note
|
||||||
|
|
||||||
|
## Constants
|
||||||
|
|
||||||
|
CCCEDICT = Path(__file__).parent / "cedict_ts.u8"
|
||||||
|
OUTPUT = Path(__file__).parent / "OUTPUT.tsv"
|
||||||
|
TEXT = "卡 陪 营业厅 附近 墙 贴 广告 排队 大概 营业员 对 一下 护照 让 选 充值 国内 国际 长途 费 下载 软件 发 短信 收 邮件 出来 办 又 习惯 自动取款机 取 能 网站 怕 麻烦 付 方法 电池 充电器 快递 应该 手表 寄 久 去年 客户 服务 帮 台 空调 最近 奇怪 修 地址 准备 办法 打开 按"
|
||||||
|
|
||||||
|
|
||||||
|
## Classess
|
||||||
|
|
||||||
|
## Main
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = CedictParser()
|
||||||
|
parser.read_file(CCCEDICT)
|
||||||
|
entries = parser.parse()
|
||||||
|
|
||||||
|
dictionary = {}
|
||||||
|
for entry in entries:
|
||||||
|
dictionary[entry.simplified] = entry
|
||||||
|
|
||||||
|
results = []
|
||||||
|
for word in TEXT.split():
|
||||||
|
if v := dictionary.get(word):
|
||||||
|
results.append(v)
|
||||||
|
else:
|
||||||
|
print(f"ERROR: {word} not found")
|
||||||
|
|
||||||
|
with OUTPUT.open("w", encoding='utf8', newline="") as csvfile:
|
||||||
|
writer = csv.writer(csvfile, delimiter='\t', quotechar='"')
|
||||||
|
for entry in results:
|
||||||
|
writer.writerow(
|
||||||
|
[
|
||||||
|
", ".join(entry.meanings),
|
||||||
|
PinyinToneConverter().convert_text(entry.pinyin),
|
||||||
|
entry.simplified,
|
||||||
|
entry.traditional,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
BIN
anki-hsk-creator/__pycache__/__init__.cpython-314.pyc
Normal file
BIN
anki-hsk-creator/__pycache__/__init__.cpython-314.pyc
Normal file
Binary file not shown.
BIN
anki-hsk-creator/__pycache__/__main__.cpython-314.pyc
Normal file
BIN
anki-hsk-creator/__pycache__/__main__.cpython-314.pyc
Normal file
Binary file not shown.
124241
anki-hsk-creator/cedict_ts.u8
Normal file
124241
anki-hsk-creator/cedict_ts.u8
Normal file
File diff suppressed because it is too large
Load Diff
8
anki_hsk_creator.egg-info/PKG-INFO
Normal file
8
anki_hsk_creator.egg-info/PKG-INFO
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Metadata-Version: 2.4
|
||||||
|
Name: anki-hsk-creator
|
||||||
|
Version: 0.1
|
||||||
|
License-File: LICENSE
|
||||||
|
Requires-Dist: cedict-utils
|
||||||
|
Requires-Dist: pinyin-tone-converter
|
||||||
|
Dynamic: license-file
|
||||||
|
Dynamic: requires-dist
|
||||||
10
anki_hsk_creator.egg-info/SOURCES.txt
Normal file
10
anki_hsk_creator.egg-info/SOURCES.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
LICENSE
|
||||||
|
README.md
|
||||||
|
setup.py
|
||||||
|
anki-hsk-creator/__init__.py
|
||||||
|
anki-hsk-creator/__main__.py
|
||||||
|
anki_hsk_creator.egg-info/PKG-INFO
|
||||||
|
anki_hsk_creator.egg-info/SOURCES.txt
|
||||||
|
anki_hsk_creator.egg-info/dependency_links.txt
|
||||||
|
anki_hsk_creator.egg-info/requires.txt
|
||||||
|
anki_hsk_creator.egg-info/top_level.txt
|
||||||
1
anki_hsk_creator.egg-info/dependency_links.txt
Normal file
1
anki_hsk_creator.egg-info/dependency_links.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
2
anki_hsk_creator.egg-info/requires.txt
Normal file
2
anki_hsk_creator.egg-info/requires.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
cedict-utils
|
||||||
|
pinyin-tone-converter
|
||||||
1
anki_hsk_creator.egg-info/top_level.txt
Normal file
1
anki_hsk_creator.egg-info/top_level.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
anki-hsk-creator
|
||||||
Reference in New Issue
Block a user