-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
29 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import csv | ||
import os | ||
import re | ||
from shutil import copyfile | ||
|
||
path_syllabs = "./syllabs/" | ||
syllabs_list = os.listdir(path_syllabs) | ||
|
||
with open("./data/source.csv", "r", newline="", encoding="UTF8") as csvfile: | ||
reader = csv.reader(csvfile, delimiter="\t") | ||
for line in reader: | ||
for s in syllabs_list: | ||
if line[2] in s: | ||
copyfile(path_syllabs + s, "./media/audio/" + s) | ||
|
||
def copy_audio_from_cmn(): | ||
with open("./data/source.csv", "r", newline="", encoding="UTF8") as csvfile: | ||
reader = csv.reader(csvfile, delimiter="\t") | ||
for line in reader: | ||
for s in syllabs_list: | ||
if line[2] in s: | ||
copyfile(path_syllabs + s, "./media/audio/" + s) | ||
|
||
|
||
if __name__ == "__main__": | ||
copy_audio_from_cmn() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
from makeAncientImgUrlList import * | ||
from downloadAncientImg import * | ||
from generateDeck import * | ||
from getRadicalsData import * | ||
|
||
import os | ||
from addExamplesToSource import add_examples_to_source | ||
from downloadAncientImg import download_ancient_img | ||
from generateDeck import generate_deck | ||
from getRadicalsData import get_radicals_data | ||
from makeAncientImgUrlList import make_ancient_img_url_list | ||
|
||
MAKE_NEW_ANCIENT_IMG_LIST = False | ||
REDOWNLOAD_ANCIENT_IMG = False | ||
|
||
if __name__ == "__main__": | ||
if MAKE_NEW_ANCIENT_IMG_LIST: | ||
makeAncientImgUrlList() | ||
make_ancient_img_url_list() | ||
if REDOWNLOAD_ANCIENT_IMG: | ||
downloadAncientImg() | ||
getRadicalsData() | ||
overwriteRadicalData() | ||
os.system("node addExamplesToSource.js") #todo: replace this by python script | ||
generateDeck() | ||
download_ancient_img() | ||
get_radicals_data() | ||
add_examples_to_source() | ||
generate_deck() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
genanki | ||
bs4 | ||
certifi | ||
pinyin | ||
hanzipy | ||
requests |