Repository navigation
Data model
Eric Kidd edited this page Dec 8, 2017
·
1 revision
I'm working on a draft data model for substudy. Ideally, this should work with a number of other language-learning tools.
{
"title": "My favorite series episode 1",
"attachment": {
"mimeType": "video/mp4",
"relpath": "favorite_series_01.mp4"
},
"syncItems": [
{
"span": { "begin": 10.5, "end": 15.9 },
"syncTracks": [
{
"type": "text",
"language": "fr",
"text": "Hé, les gars`"
},
{
"type": "text",
"language": "en",
"text": "Hey, guys!"
},
]
}
]
}The structure looks like this:
-
MediaFile: An episode, movie or chapter.-
SyncItem: A subtitle, sentence or small set of sentences that exists in more than one language.-
SyncTrack: A single version of theSyncItem, in a specific language and media. So this might be "French subtitle", "English subtitle", "image", etc.
-
-
Note that I may rename these if I find better names!
For some proposed fields, see below.
-
mimeType: String: The MIME type of this file. -
relPath: PathBuf: The path to this file, relative to some "root".
-
begin: f32: The beginning time. -
end: f32: The ending time. Must be greater than or equal tobegin.
-
title: Option<String>: The title of this media item, if any. -
attachment: Option<Attachment>: An external audio or video file associated with thisMediaFile. May be omitted in the case of book chapters. -
syncItems: Vec<SyncItem>: Individual synchronized subtitles or sentences.
-
span: Option<TimeSpan>: An optional time period associated with this item. This will beNoneif we're just synchronizing two pieces of plain text without any timing information. -
syncTracks: Vec<SyncTracks>: Different versions of thisSyncItemin different languages or media types.
-
type: String: One oftext,image,media,notes, etc. -
language: Option<String>: The language this item is in, using an ISO 639-1 code when possible, or an ISO 639-2 code otherwise. -
attachment: Option<Attachment>: Any image, etc., that we want to attach. -
text: Option<String>: Any associated text.