The TitleMunger class manipulates title strings to provide alternate representations of the data.
Film Title
Sort Title
Unique ID Title
Catalog Title
V. I. Warshawski
vi_warshawski
vi_warshawski-1991-1
V.I. Warshawski (1991)
The Whole Nine Yards
whole_nineyards+the
whole_nineyards+the-2000-1
The Whole Nine Yards (2000)
3:10 To Yuma
three_ten_to_yuma
three_ten_to_yuma-1957-1
3:10 To Yuma (1957)
One variant that was created (but not documented) was a filename suitable string, which would be suitable if the data needed to be written out into a file.
Film Title
Sort Title
Unique ID Title
Catalog Title
Filename
V. I. Warshawski
vi_warshawski
vi_warshawski-1991-1
V.I. Warshawski (1991)
v_i_warshawski
The Whole Nine Yards
whole_nineyards+the
whole_nineyards+the-2000-1
The Whole Nine Yards (2000)
the_whole_nine_yards
3:10 To Yuma
three_ten_to_yuma
three_ten_to_yuma-1957-1
3:10 To Yuma (1957)
310_to_yuma
If an operation generates a large number of files (one file per content title), it would be beneficial to have a tree structure to prevent a single directory having all of the files. For building repositories, we already recommend a tree structure based on the title, so we could add a method to TitleMunger that figures out the path.
Film Title
Sort Title
Unique ID Title
Catalog Title
Filename
Directory Path
V. I. Warshawski
vi_warshawski
vi_warshawski-1991-1
V.I. Warshawski (1991)
vi_warshawski
v/vii
The Whole Nine Yards
whole_nineyards+the
whole_nineyards+the-2000-1
The Whole Nine Yards (2000)
the_whole_nine_yards
w/whs
3:10 To Yuma
three_ten_to_yuma
three_ten_to_yuma-1957-1
3:10 To Yuma (1957)
310_to_yuma
3/31a
The path expression is based on the first letter of the first word in the title (unless that word is an article like 'the' or 'a'), followed by the first two letters and then the last letter of the title.
Create a method in the TitleMunger class to generate the path information and return it as a string.
The
TitleMunger
class manipulates title strings to provide alternate representations of the data.One variant that was created (but not documented) was a filename suitable string, which would be suitable if the data needed to be written out into a file.
If an operation generates a large number of files (one file per content title), it would be beneficial to have a tree structure to prevent a single directory having all of the files. For building repositories, we already recommend a tree structure based on the title, so we could add a method to TitleMunger that figures out the path.
The path expression is based on the first letter of the first word in the title (unless that word is an article like 'the' or 'a'), followed by the first two letters and then the last letter of the title.
Create a method in the
TitleMunger
class to generate the path information and return it as a string.