class OdeonUk::Internal::TitleSanitizer
Sanitize and standardize film titles
Private Instance Methods
remove()
click to toggle source
strings and regex to be removed
# File lib/odeon_uk/internal/title_sanitizer.rb, line 19 def remove [ /\s+[23][dD]/, # dimension 'Autism Friendly Screening -', # autism screening /\ACinemagic \d{1,4} \-/, # cinemagic /\(encore.+\)/i, # encore for NT Live /\(live\)/i, # live in brackets 'UKJFF -', # UK Jewish festival prefix /\bsing\-?a\-?long\b/i, # singalong 'Autism Friendly - ', # autism friendly 'amp;', # html ampersands ] end
replace()
click to toggle source
regexes and their replacements
# File lib/odeon_uk/internal/title_sanitizer.rb, line 34 def replace { /Bolshoi - (.*)/ => 'Bolshoi: ', /Globe On Screen: (.*)/ => 'Globe: ', /Met Opera - (.*)/ => 'Met Opera: ', /National Theatre Live - (.*)/ => 'National Theatre: ', /NT Live - (.*)/ => 'National Theatre: ', /ROH - (.*)/ => 'Royal Opera House: ', /(.*)\- RSC Live \d{1,4}/ => 'Royal Shakespeare Company: ' } end