cldf-datasets/doreco

Add MediaTable

Closed this issue · 1 comments

Copying from #8:

  • to add a MediaTable linking the lexical data to the audio files.

@xrotwang Quite lost on how we would proceed to implement this. Is this something you will take charge of?

See

doreco/cldfbench_doreco.py

Lines 221 to 241 in ac227b3

for i, row in enumerate(self.iter_rows('*_metadata.csv'), start=1):
if row['extended'] == 'yes':
continue
fid = 'doreco_{}'.format(global_id(row['Glottocode'], row["name"]))
if fid in filemd[row['Glottocode']]:
args.writer.objects["MediaTable"].append({
"ID": fid,
'Name': '{}.wav'.format(row['name']),
"rec_date": row["rec_date"],
"rec_date_assignment_certain": row["rec_date_c"],
"genre": row["genre"],
"genre_stim": row["genre_stim"],
"gloss": row["gloss"],
"transl": row["transl"].split('/'),
"sound_quality": row["sound_quality"],
"background_noise": row["background_noise"],
"Glottocode": row["Glottocode"],
"Corpus_ID": row["Glottocode"],
"Download_URL": filemd[row['Glottocode']][fid][0],
'Media_Type': 'audio/x-wav',
})