Skip to content

Commit

Permalink
init version
Browse files Browse the repository at this point in the history
  • Loading branch information
Omnisch committed Sep 3, 2024
1 parent 5d8ea8b commit 8e723a8
Show file tree
Hide file tree
Showing 6 changed files with 50,764 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"json.schemas": [
{
"fileMatch": ["index.json"],
"url": "https://github.com/themoeway/yomitan/raw/master/ext/data/schemas/dictionary-index-schema.json"
},
{
"fileMatch": ["kanji_bank_*.json"],
"url": "https://github.com/themoeway/yomitan/raw/master/ext/data/schemas/dictionary-kanji-bank-v3-schema.json"
},
{
"fileMatch": ["kanji_meta_bank_*.json"],
"url": "https://github.com/themoeway/yomitan/raw/master/ext/data/schemas/dictionary-kanji-meta-bank-v3-schema.json"
},
{
"fileMatch": ["tag_bank_*.json"],
"url": "https://github.com/themoeway/yomitan/raw/master/ext/data/schemas/dictionary-tag-bank-v3-schema.json"
},
{
"fileMatch": ["term_bank_*.json"],
"url": "https://github.com/themoeway/yomitan/raw/master/ext/data/schemas/dictionary-term-bank-v3-schema.json"
},
{
"fileMatch": ["term_meta_bank_*.json"],
"url": "https://github.com/themoeway/yomitan/raw/master/ext/data/schemas/dictionary-term-meta-bank-v3-schema.json"
}
],
}
10 changes: 10 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"author": "Aoyama ([email protected])",
"description": "MCPDict, A Phonology Dictionary in CJKV",
"downloadUrl": "https://github.com/omnilingual/mcpdict-for-yomitan/releases/download/alpha_1.5/mcpdict_for_yomitan_a1.5.zip",
"format": 3,
"indexUrl": "https://github.com/omnilingual/mcpdict-for-yomitan/releases/latest/download/mcpdict_index.json",
"isUpdatable": true,
"revision": "aoyama_mcpdict_alpha1.5",
"title": "MCPDict"
}
1 change: 1 addition & 0 deletions kanji_bank_1.json

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions res/create_table_stripped.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 3 20:31:02 2024
@author: Omnis
"""

indices = [
'字頭', #0
'反切', #1
'切韻擬音', #2
'字類', #3
'聲形-聲', #4
'聲形-形', #5
'小韻首字', #6
'釋義', #7
'釋義補充', #8
'聲紐', #9
'攝', #10
'韻部', #11
'等', #12
'呼', #13
'聲調', #14
'聲旁', #15
'A/B類分析', #16
'聲形析微', #17
]

raw = open('guangyun_stripped.csv', 'r', encoding='utf-8')
lines = raw.readlines()
raw.close()

with open('kanji_bank_1.json', 'w', encoding='utf-8') as o:
o.write('[')
for line in lines:
items = line.strip().split(',')
keyChr = items[0]
prn = items[1] + '切 ' + items[2]


expList = []
if items[3] == '':
items[3] = '形聲'
expList.append('"' + items[3] + '字,' + items[5] + items[4] + '"')
if items[6] != '':
expList.append('"' + indices[6] + '"')
if items[8] != '':
expList.append('"' + items[7] + '(' + items[8] + ')"')
else:
expList.append('"' + items[7] + '"')
expList.append('"' + ''.join(items[9:15]) + ' ' + items[15] + '聲"')
if items[16] != '':
expList.append('"※' + indices[16] + ':' + items[16] + '"')
if items[17] != '':
expList.append('"' + indices[17] + ':' + items[17] + '"')

o.write('["' + keyChr + '","' + prn + '","","",[' + ','.join(expList) + '],{}],')
o.write(']')
Loading

0 comments on commit 8e723a8

Please sign in to comment.