Skip to content

匯媠聲台大錄音檔

Sih Sîng-hông薛丞宏 edited this page Jul 15, 2022 · 1 revision
import json
from kupan.models import Lē, Khuán
from os.path import join


with open('/djangoAdmin/media/jiboo/tsuliau.json') as tong:
    tsuliau = json.load(tong)

for pianho in sorted(tsuliau.keys()):
    mih = tsuliau[pianho]
    tó一款句辦, _sin = Khuán.objects.get_or_create(miâ=mih[0])
    le = Lē.objects.create(
        漢字=mih[1],
        羅馬字含口語調=mih[2],
        音檔=join('jiboo', mih[3]),
    )
    le.tó一款句辦.add(tó一款句辦)
Clone this wiki locally