Or: don't name your article ‘paper.pdf’. Name it like this ...
These give most of the idea:
The-Practice-Of-Programming_Kernighan-Pike_1999.ISBN-020161586X.djvu
Concerto-2-E-min-RV279-1-Allegro_Vivaldi_1713-1995.ISRC-GBFO77341004.v245.mp3
Missa-Papae-Marcelli-Kyrie_Palestrina-TheTallisScholars_1562-1999.ISRC-GBADM9400034.v245.mp3
Sparrow-On-The-Crabapple-Tree_Anderson_2007.flickr-734188511.1024x683.jpg
‘TADIST’ is an acronym: the format is basically:
title _ author _ date . id . subtype . type
But some parts can be omitted, so then the schema is roughly (with [] meaning optional):
title [_ author [_ date]] [. id] [. subtype] . type
Furthermore, each part (except the type) can have sub-parts separated by ‘-
’, so (with ... meaning possible repetition):
ttt-tt-... [_ aaa-aa-... [_ ddd-dd-...]] [. iii-iiii] [. sss ] . type
The semantics of sub-parts vary though:
-
’ means space)-
’ means ‘,’)-
’ separates those two)And more detail on some elements:
ISBN-9780631128014
100x60.png
, c320.mp3
jpg
, epub
, mp3
These are all assembled only from three character classes which are easy to handle in file names:
0123456789
-
_
.
To be more exact, here is the grammar in SBNF:
(filename (, plain meta)) (plain (, title (? (, "_" author (? (, "_" date)))))) (title (+ alphnum "-")) (author (+ alphnum "-")) (date (+ (, year (? (, month (? day)))) "-")) (meta (, (? (, "." id)) (? (, "." subtype)) "." type)) (id (, alphnum "-" alphnum)) (subtype alphnum) (type alphnum) (year (, (? "-") (| (=4 digit) (, (=3 digit) "X") (, (=2 digit) "XX") (, digit "XXX")))) (month (| "01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12")) (day (| (, "0" (| "1" "2" "3" "4" "5" "6" "7" "8" "9")) (, (| "1" "2") digit) (, "3" (| "0" "1")))) (alphnum (+ (| letter digit))) (digit (| "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"))
Assuming:
letter
– at least ASCIIComments:
ISBN-9780631128014
100x60.png
, c320.mp3
jpg
, epub
, mp3
-
” for BCE, and has a non-standard augmentation: “X
” for unknownThe data-structure would be something like this (in quasi-code, where :
means ‘of type’):
filename : product of { title : array of { string } , author : array of { string } , date : array of { ISO8601-date } , id : option of { product of { label : string , value : string } } , subtype : option of string , type : string }
where strings are alpha-numeric only and non-zero length, and the title array has at least one element.
The name pattern also has a plain-text form, so e.g.:
"The Practice Of Programming" ; Kernighan, Pike ; 1999 / ISBN-020161586X / djvu .
is the text representation of:
The-Practice-Of-Programming_Kernighan-Pike_1999.ISBN-020161586X.djvu
The grammar in SBNF:
(textform (, plain meta " .")) (plain (, title (? (, " ; " author (? (, " ; " date)))))) (title (, "\"" chars-no-dquos "\"")) (author (+ chars-no-commas-or-semicolons-or-slashes ", ")) (date (+ (, year (? (, "-" month (? "-" day)))) ", ")) (meta (, (? (, " / " id)) (? (, " / " subtype)) " / " type)) (id (, alphnum "-" alphnum)) (subtype alphnum) (type alphnum) (year (, (? "-") (| (=4 digit) (, (=3 digit) "X") (, (=2 digit) "XX") (, digit "XXX")))) (month (| "01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12")) (day (| (, "0" (| "1" "2" "3" "4" "5" "6" "7" "8" "9")) (, (| "1" "2") digit) (, "3" (| "0" "1")))) (alphnum (+ (| letter digit))) (digit (| "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"))
Assuming:
chars-no-dquos
chars-no-commas-or-semicolons-or-slashes
letter
– at least ASCIIComments: