From daeb28baeff206bf72a5cf68e3a3a493f99d5c9e Mon Sep 17 00:00:00 2001 From: Vitiko Date: Wed, 12 Oct 2022 19:04:42 -0400 Subject: [PATCH] Update subzero mods --- .../modification/mods/hearing_impaired.py | 2 +- libs/subzero/modification/mods/ocr_fixes.py | 6 +- tests/subliminal_patch/data/subs_for_mods.srt | 1661 +++++++++++++++++ tests/subliminal_patch/test_mods.py | 16 + 4 files changed, 1681 insertions(+), 4 deletions(-) create mode 100644 tests/subliminal_patch/data/subs_for_mods.srt create mode 100644 tests/subliminal_patch/test_mods.py diff --git a/libs/subzero/modification/mods/hearing_impaired.py b/libs/subzero/modification/mods/hearing_impaired.py index 87a46887b..49bf57096 100644 --- a/libs/subzero/modification/mods/hearing_impaired.py +++ b/libs/subzero/modification/mods/hearing_impaired.py @@ -34,7 +34,7 @@ class HearingImpaired(SubtitleTextModification): # uppercase text before colon (at least 3 uppercase chars); at start or after a sentence, # possibly with a dash in front; ignore anything ending with a quote - NReProcessor(re.compile(r'(?u)(?:(?<=^)|(?<=[.\-!?\"\']))([\s\->~]*(?=[A-ZÀ-Ž&+]\s*[A-ZÀ-Ž&+]\s*[A-ZÀ-Ž&+])' + NReProcessor(re.compile(r'(?u)(?:(?<=^)|(?<=[.\-!?\"\'])\s)([\s\->~]*(?=[A-ZÀ-Ž&+]\s*[A-ZÀ-Ž&+]\s*[A-ZÀ-Ž&+])' r'[A-zÀ-ž-_0-9\s\"\'&+()\[\],:]+:(?![\"\'’ʼ❜‘‛”“‟„])(?:\s+|$))(?![0-9])'), "", name="HI_before_colon_caps"), diff --git a/libs/subzero/modification/mods/ocr_fixes.py b/libs/subzero/modification/mods/ocr_fixes.py index 31fc94cdc..1b2940dcd 100644 --- a/libs/subzero/modification/mods/ocr_fixes.py +++ b/libs/subzero/modification/mods/ocr_fixes.py @@ -39,9 +39,9 @@ class FixOCR(SubtitleTextModification): return [ # remove broken HI tag colons (ANNOUNCER'., ". instead of :) after at least 3 uppercase chars # don't modify stuff inside quotes - NReProcessor(re.compile(r'(?u)(^[^"\'’ʼ❜‘‛”“‟„]*(?<=[A-ZÀ-Ž]{3})[A-ZÀ-Ž-_\s0-9]+)' - r'(["\'’ʼ❜‘‛”“‟„]*[.,‚،⹁、;]+)(\s*)(?!["\'’ʼ❜‘‛”“‟„])'), - r"\1:\3", name="OCR_fix_HI_colons", supported=lambda p: not p.only_uppercase), + #NReProcessor(re.compile(r'(?u)(^[^"\'’ʼ❜‘‛”“‟„]*(?<=[A-ZÀ-Ž]{3})[A-ZÀ-Ž-_\s0-9]+)' + # r'(["\'’ʼ❜‘‛”“‟„]*[.,‚،⹁、;]+)(\s*)(?!["\'’ʼ❜‘‛”“‟„])'), + # r"\1:\3", name="OCR_fix_HI_colons", supported=lambda p: not p.only_uppercase), # fix F'bla NReProcessor(re.compile(r'(?u)(\bF)(\')([A-zÀ-ž]*\b)'), r"\1\3", name="OCR_fix_F"), WholeLineProcessor(self.data_dict["WholeLines"], name="OCR_replace_line"), diff --git a/tests/subliminal_patch/data/subs_for_mods.srt b/tests/subliminal_patch/data/subs_for_mods.srt new file mode 100644 index 000000000..215726787 --- /dev/null +++ b/tests/subliminal_patch/data/subs_for_mods.srt @@ -0,0 +1,1661 @@ +1 +00:00:36,626 --> 00:00:38,992 +D'oh! + +2 +00:00:55,554 --> 00:00:57,044 +Stupid junk mail. + +3 +00:00:58,657 --> 00:01:00,591 +Yeah. Win this. + +4 +00:01:02,261 --> 00:01:04,525 +I'll see that he gets it. + +5 +00:01:04,596 --> 00:01:07,963 +How dumb do they think I am? +Huh? A check? + +6 +00:01:08,033 --> 00:01:11,560 +One million dollars. + +7 +00:01:11,637 --> 00:01:16,131 +I'm rich! + +8 +00:01:18,777 --> 00:01:21,803 +Mr. Simpson, I can assure you, +this check of yours is nonnegotiable. + +9 +00:01:21,880 --> 00:01:25,372 +Oh, yeah? +Well, what makes you so damn sure? + +10 +00:01:25,451 --> 00:01:28,249 +See where it says "Void, void, void" +and "This is not a check"? + +11 +00:01:28,320 --> 00:01:30,686 +"Cash value +1 /20th of a cent." + +12 +00:01:30,756 --> 00:01:32,724 +- " Mr. Banker, do not honor." +- Shut up. + +13 +00:01:32,791 --> 00:01:36,056 +I had a feeling it was +too good to be true. + +14 +00:01:36,128 --> 00:01:39,495 +Every time you get a million dollars, +something queers the deal. + +15 +00:01:39,565 --> 00:01:42,432 +I don't think real checks +have exclamation points. + +16 +00:01:42,501 --> 00:01:44,992 +Well, at least we got +a free sample of Reading Digest. + +17 +00:01:45,070 --> 00:01:49,006 +Marge, I never read +a magazine in my life, +and I'm not gonna start now. + +18 +00:01:49,074 --> 00:01:51,099 +Hey, a cartoon! + +19 +00:01:54,813 --> 00:01:56,838 +Ain't it the truth? + +20 +00:01:56,915 --> 00:01:58,644 +No, it's not the truth, Homer. + +21 +00:01:58,717 --> 00:02:01,652 +It's well-documented that women +are safer drivers than men. + +22 +00:02:01,720 --> 00:02:04,883 +Oh, Marge, cartoons +don't have any deep meaning. + +23 +00:02:04,957 --> 00:02:07,425 +They're just stupid drawings +that give you a cheap laugh. + +24 +00:02:10,496 --> 00:02:12,430 +Hey, Einstein, +put down your reading. + +25 +00:02:12,498 --> 00:02:14,022 +- It's lunchtime. +- You go ahead. + +26 +00:02:14,099 --> 00:02:16,659 +Hey, you don't wanna eat? +What you do, get one of them +stomach staples? + +27 +00:02:16,735 --> 00:02:19,295 +As Tolstoy said +in Quotable Notables... + +28 +00:02:19,371 --> 00:02:22,932 +"Give me learning, sir, +and you may keep your black bread." + +29 +00:02:23,008 --> 00:02:25,476 +- Who is that bookworm, Smithers? +- Homer Simpson, sir. + +30 +00:02:25,544 --> 00:02:28,240 +Simpson, eh? +How very strange. + +31 +00:02:28,313 --> 00:02:31,441 +His job description +clearly specifies an illiterate. + +32 +00:02:31,517 --> 00:02:36,113 +We now return to Troy McClure +and Delores Montenegro +in Preacher With a Shovel. + +33 +00:02:36,188 --> 00:02:39,180 +But Irrigation can save +your people, Chief Smiling Bear. + +34 +00:02:39,258 --> 00:02:41,852 +Marge, look at them +staring at that idiot box. + +35 +00:02:41,927 --> 00:02:45,055 +God forbid they would +ever read something +and improve their minds. + +36 +00:02:45,130 --> 00:02:47,428 +You've certainly taken +a shine to that magazine. + +37 +00:02:47,499 --> 00:02:49,865 +It's not just +one magazine, Marge. + +38 +00:02:49,935 --> 00:02:53,530 +They take hundreds of magazines, +filter out the crap... + +39 +00:02:53,605 --> 00:02:57,166 +and leave you with something +that fits right in your front pocket. + +40 +00:03:00,579 --> 00:03:03,810 +God! Those kids don't know +what they're missing. + +41 +00:03:05,784 --> 00:03:07,979 +- Dad! +- Hey, what gives, man? + +42 +00:03:08,053 --> 00:03:09,987 +the House of Representatives +on C-SPAN, + +43 +00:03:10,055 --> 00:03:13,286 +and listen to an inspiring story +of wilderness survival. + +44 +00:03:13,358 --> 00:03:15,485 +"Then I heard the sound... + +45 +00:03:15,561 --> 00:03:17,893 +"that all +arctic explorers dread— + +46 +00:03:17,963 --> 00:03:20,727 +the pitiless bark +of the sea lion." + +47 +00:03:20,799 --> 00:03:22,460 +He'll be killed! + +48 +00:03:22,534 --> 00:03:26,368 +Homer, he obviously got out alive +if he wrote the article. + +49 +00:03:26,438 --> 00:03:30,101 +Don't be so— +Oh, you're right. + +50 +00:03:34,079 --> 00:03:37,606 +Homey, put down your magazine +for a minute. + +51 +00:03:37,683 --> 00:03:41,210 +- Huh? +- I thought you might wanna snuggle. + +52 +00:03:41,286 --> 00:03:46,383 +That reminds me. +"Seven ways to spice up +your marriage." + +53 +00:03:46,458 --> 00:03:50,394 +Marge, "You have a nice body... + +54 +00:03:50,462 --> 00:03:54,296 +and if you'd like to +see me in a costume, +you have only to ask." + +55 +00:03:54,366 --> 00:03:55,958 +Thank you, Homey. + +56 +00:03:56,034 --> 00:03:59,663 +Wow! Little meat loaf men! + +57 +00:04:00,873 --> 00:04:02,738 +Where did you get +the idea for this, Mom? + +58 +00:04:02,808 --> 00:04:06,574 +Where do you think? +This baby never steers +you wrong, and it was free! + +59 +00:04:06,645 --> 00:04:09,136 +- Free. +- It certainly has enriched our lives. + +60 +00:04:09,214 --> 00:04:13,014 +Wow. "Win a trip +to Washington, D.C. + +61 +00:04:13,085 --> 00:04:15,952 +All expenses paid. +V.I.P. tour." + +62 +00:04:16,021 --> 00:04:19,320 +- Oh, it's for kids. +- Wait, Dad! + +63 +00:04:20,726 --> 00:04:23,695 +An essay contest. +"Children under 12. + +64 +00:04:23,762 --> 00:04:28,165 +Three-hundred words, +fiercely pro-American." +Sounds interesting. + +65 +00:04:28,233 --> 00:04:31,225 +Bart, maybe this is something +you'd like to do too. + +66 +00:04:31,303 --> 00:04:35,501 +Mom, it's a nice thought, +but we both know that +this is the pony to bet on. + +67 +00:04:37,042 --> 00:04:41,672 +What would Ben Franklin say +if he were alive today? + +68 +00:04:41,747 --> 00:04:44,477 +He'd say, uh... + +69 +00:04:44,550 --> 00:04:46,142 +"Think of a better opening." + +70 +00:04:46,218 --> 00:04:48,618 +- How's it going, honey? +- Not very well. + +71 +00:04:48,687 --> 00:04:52,054 +Well, when I used to +get stuck like this, +I'd go for a bike ride. + +72 +00:04:52,124 --> 00:04:55,116 +- Do kids go +on bike rides anymore? +- Yes! + +73 +00:04:55,193 --> 00:04:58,754 +I don't know. +I thought maybe bikes +weren't cool anymore. + +74 +00:04:58,830 --> 00:05:03,028 +- Do kids still use that word "cool"? +- Yes, Mom! + +75 +00:05:11,009 --> 00:05:14,376 +Okay, America, inspire me. + +76 +00:05:16,848 --> 00:05:19,146 +Wow, a bald eagle. + +77 +00:05:22,120 --> 00:05:24,611 +Hmm. + +78 +00:05:24,690 --> 00:05:26,749 +Thanks for driving me +to the contest, Dad. + +79 +00:05:26,825 --> 00:05:29,988 +Sweetheart, there's nothing +I wouldn't do for that magazine. + +80 +00:05:30,062 --> 00:05:33,998 +"So burn the flag if you must, +but before you do... + +81 +00:05:34,066 --> 00:05:36,159 +"you better burn +a few other things. + +82 +00:05:36,234 --> 00:05:38,532 +"You better burn your shirt +and your pants. + +83 +00:05:38,604 --> 00:05:40,970 +" Be sure to burn +your TV and car. + +84 +00:05:41,039 --> 00:05:43,405 +"Oh, yes, and don't forget +to burn your house... + +85 +00:05:43,475 --> 00:05:47,377 +"because none of those things +could exist without six white stripes... + +86 +00:05:47,446 --> 00:05:51,041 +seven red stripes +and a hell of a lot of stars." + +87 +00:05:51,116 --> 00:05:52,811 +Thank you very much. + +88 +00:05:52,884 --> 00:05:55,614 +Yeah! Damn right! + +89 +00:05:58,690 --> 00:06:03,559 +" Recipe for a free country: +Mix one cup liberty with +three teaspoons of justice. + +90 +00:06:03,629 --> 00:06:06,757 +Add one informed electorate. +Baste well with veto power." + +91 +00:06:09,067 --> 00:06:12,628 +" My back is spineless. +My belly is yellow. + +92 +00:06:12,704 --> 00:06:14,729 +I am the American nonvoter." + +93 +00:06:16,975 --> 00:06:20,433 +"Stir in two cups of checks. +Sprinkle liberally with balances." + +94 +00:06:22,881 --> 00:06:25,941 +" Ding, dong. The sounds +of the Liberty Bell. + +95 +00:06:26,018 --> 00:06:29,044 +Ding— freedom. +Dong— opportunity. + +96 +00:06:29,121 --> 00:06:32,716 +Ding— excellent schools. +Dong— quality hospitals." + +97 +00:06:35,193 --> 00:06:39,152 +"When America was born +on that hotJuly day in 1 77 6... + +98 +00:06:39,231 --> 00:06:43,668 +"the trees in Springfield Forest +were tiny saplings, +trembling towards the sun. + +99 +00:06:43,735 --> 00:06:45,794 +"And as they were nourished +by Mother Earth... + +100 +00:06:45,871 --> 00:06:48,533 +"so too did our fledgling nation +find strength... + +101 +00:06:48,607 --> 00:06:51,474 +"in the simple ideals +of equality and justice. + +102 +00:06:51,543 --> 00:06:55,240 +"Who would have thought +such mighty oaks +or such a powerful nation... + +103 +00:06:55,313 --> 00:06:59,477 +could grow out of something +so fragile, so pure?" + +104 +00:06:59,551 --> 00:07:01,644 +Thank you. + +105 +00:07:03,055 --> 00:07:05,023 +- What do you think? +- It's good. + +106 +00:07:05,090 --> 00:07:06,990 +A little too good +for an eight-year-old. + +107 +00:07:07,059 --> 00:07:10,995 +Me thinks I detect +the sickly scent of the daddy. + +108 +00:07:11,063 --> 00:07:15,693 +Mr. Simpson, I'd like to +ask you a few questions +about your daughter's essay. + +109 +00:07:15,767 --> 00:07:18,827 +- Lisa, will you excuse us? +- Okay. + +110 +00:07:18,904 --> 00:07:21,498 +"We the purple"? +What the hell was that? + +111 +00:07:21,573 --> 00:07:24,303 +- Are you a professional writer? +- Mm-mmm. + +112 +00:07:24,376 --> 00:07:26,435 +Are you interested in +politics or government? + +113 +00:07:26,511 --> 00:07:28,172 +I don't know. + +114 +00:07:28,246 --> 00:07:31,807 +- Are you interested in anything? +- I don't know. + +115 +00:07:31,883 --> 00:07:35,250 +- Could you touch your nose for me? Hmm. +- Mm. Hmm. + +116 +00:07:37,522 --> 00:07:40,184 +Lisa, after meeting +your father... + +117 +00:07:40,258 --> 00:07:42,886 +I've decided to award you +an additional five points. + +118 +00:07:42,961 --> 00:07:46,556 +Congratulations. +You and your family +are going to Washington. + +119 +00:07:46,631 --> 00:07:48,963 +Wa-hoo! +Who would have guessed... + +120 +00:07:49,034 --> 00:07:52,165 +reading and writing +would pay off? + +121 +00:08:01,074 --> 00:08:04,100 +- Yes, sir, can I get you something? +- Playing cards, notepad... + +122 +00:08:04,177 --> 00:08:06,611 +aspirin, sewing kit, +pilot's wing pin... + +123 +00:08:06,679 --> 00:08:08,977 +propeller-shaped swizzle stick, +sleeping mask... + +124 +00:08:09,048 --> 00:08:12,245 +- and anything else +I've got coming to me. +- I'll see what I can do. + +125 +00:08:12,318 --> 00:08:15,287 +Hmm. + +126 +00:08:15,354 --> 00:08:18,619 +Steward! + +127 +00:08:18,691 --> 00:08:21,683 +Little boy, I bet you'd like to +visit the cockpit. + +128 +00:08:21,761 --> 00:08:23,285 +Ooh-ooh, baby! + +129 +00:08:23,362 --> 00:08:26,798 +And this control stick is like +the handlebars on your tricycle. + +130 +00:08:26,866 --> 00:08:28,959 +Now, would you +like to see where +we hang our coats? + +131 +00:08:29,035 --> 00:08:31,799 +No, thank you. +I'd rather push +this button. Oops! + +132 +00:08:31,871 --> 00:08:34,101 +No! + +133 +00:08:34,173 --> 00:08:36,869 +We're all gonna die! + +134 +00:08:39,645 --> 00:08:45,481 +Look, Marge, that guy has +the same last name we do. Taxi.! + +135 +00:08:46,886 --> 00:08:49,753 +Oh, look, Homer, +the I.R.S. + +136 +00:08:49,822 --> 00:08:53,485 +- Boo! +- Oh, boo yourself. + +137 +00:08:53,559 --> 00:08:57,154 +Here we are, kids. +The Watergate. + +138 +00:09:07,740 --> 00:09:09,674 +Hey! + +139 +00:09:09,742 --> 00:09:13,303 +Homer, look.! +They give you a shower cap... + +140 +00:09:13,379 --> 00:09:16,678 +and body gel +and bathrobes. + +141 +00:09:16,749 --> 00:09:19,547 +And a welcoming mint +on your pillow. + +142 +00:09:19,619 --> 00:09:23,521 +Wow, a shoehorn. +Just like in the movies. + +143 +00:09:23,589 --> 00:09:27,787 +Shoe goes on, shoe goes off, +shoe goes on, shoe goes off. + +144 +00:09:27,860 --> 00:09:30,124 +Shoe goes on, +shoe goes off. + +145 +00:09:30,196 --> 00:09:32,130 +Hey, I call first bedsies. + +146 +00:09:32,198 --> 00:09:35,690 +Bart, there's no such thing +as first bedsies. +You just made that up. + +147 +00:09:35,768 --> 00:09:37,702 +Well, okay, +which one do you want? + +148 +00:09:37,770 --> 00:09:40,796 +I... want... that one. + +149 +00:09:40,873 --> 00:09:43,307 +Really? +You want that one? + +150 +00:09:43,376 --> 00:09:45,139 +It's all yours. +Whatever you say. + +151 +00:09:45,211 --> 00:09:47,543 +- Why? What's wrong with it? +- Nothing. + +152 +00:09:47,613 --> 00:09:49,877 +- Have a good night's sleep, Lisa. +- No, really, what? + +153 +00:09:49,949 --> 00:09:51,883 +- Nothing. +- What did you do to it? + +154 +00:09:51,951 --> 00:09:54,317 +- Nothing. +- Mom! + +155 +00:09:56,489 --> 00:10:00,255 +What the— D'oh! +Stupid welcoming mint! + +156 +00:10:00,326 --> 00:10:03,591 +- Hello? +- Good morning. +This is your wake-up call. + +157 +00:10:03,663 --> 00:10:06,029 +Wake-up call? +It's 2:00 a.m. + +158 +00:10:06,098 --> 00:10:08,032 +Sorry, fatso. + +159 +00:10:11,237 --> 00:10:14,229 +Free food? + +160 +00:10:14,307 --> 00:10:18,903 +Lisa, I'm Faith Crowley— +patriotism editor of Reading Digest. + +161 +00:10:18,978 --> 00:10:20,912 +Oh, I love your magazine. + +162 +00:10:20,980 --> 00:10:23,278 +My favorite section is +" How to Increase Your Word Power." + +163 +00:10:23,349 --> 00:10:27,979 +That thing is really, +really, really... good. + +164 +00:10:28,054 --> 00:10:32,388 +Well, good. +Lisa, I'd like you to meet +some other finalists. + +165 +00:10:32,458 --> 00:10:35,586 +- This is Trong Van Dinh +and Maria Dominguez. +- Hello. + +166 +00:10:35,661 --> 00:10:38,129 +Maria is the National +Spelling Bee Champion. + +167 +00:10:38,197 --> 00:10:41,257 +And Trong has won both +the Westinghouse Talent Search... + +168 +00:10:41,334 --> 00:10:44,667 +and the NFL Punt, +Pass and Kick Competition. + +169 +00:10:44,737 --> 00:10:48,673 +Have either of you ever run +into any problems because +of your superior ability? + +170 +00:10:48,741 --> 00:10:52,268 +- Hmm? +- Sure, I guess. +- Oh, me too! + +171 +00:10:53,646 --> 00:10:55,807 +These are special +V.I.P. badges. + +172 +00:10:55,881 --> 00:10:57,906 +They'll get you into places +other tourists never see. + +173 +00:10:57,984 --> 00:11:01,647 +- Miss, what does the "I" stand for? +- Important. + +174 +00:11:01,721 --> 00:11:04,713 +- Oh! How about the "V"? +- Very. + +175 +00:11:04,790 --> 00:11:07,418 +- Oh! And, miss, +just one more question. +- Person. + +176 +00:11:07,493 --> 00:11:09,427 +Ah! + +177 +00:11:09,495 --> 00:11:11,759 +- What does the "I" stand for again? +- Oh! + +178 +00:11:16,335 --> 00:11:21,329 +- "On this spot, Richard Nixon +bowled back-to-back 300 games." +- Yeah, right. + +179 +00:11:21,407 --> 00:11:25,241 +Wow, the president's bathroom. + +180 +00:11:28,614 --> 00:11:31,515 +- Do you mind? +- Barbara Bush! + +181 +00:11:31,584 --> 00:11:34,417 +Oh, you have +those damn badges. + +182 +00:11:34,487 --> 00:11:39,083 +Okay. This tub +was installed in 1894. + +183 +00:11:40,159 --> 00:11:43,151 +Mmm. Money. + +184 +00:11:45,831 --> 00:11:47,856 +Hey, watch it, chief. + +185 +00:11:47,933 --> 00:11:51,164 +Folks, we print more than +18 million bills a day. + +186 +00:11:51,237 --> 00:11:53,762 +Oh, and in case +you were wondering... + +187 +00:11:53,839 --> 00:11:56,034 +no, we don't give out +free samples. + +188 +00:11:58,110 --> 00:12:00,044 +Lousy, cheap country. + +189 +00:12:06,018 --> 00:12:08,486 +Bart, get out +of The Spirit of St. Louis.! + +190 +00:12:11,357 --> 00:12:15,123 +Hey, what's so funny. + +191 +00:12:15,194 --> 00:12:18,755 +Oh, Marge, grow up! + +192 +00:12:20,299 --> 00:12:23,325 +Congressman, this is, uh, +Springfield National Forest. + +193 +00:12:23,402 --> 00:12:27,133 +- Now, basically, what we +wanna do is cut her down. +- Uh-huh. + +194 +00:12:27,206 --> 00:12:29,834 +As you can see +in our artist's rendition, +it's full of old growth... + +195 +00:12:29,909 --> 00:12:31,968 +just aging +and festering away. + +196 +00:12:32,044 --> 00:12:34,740 +In comes our logging company +to thin out the clutter. + +197 +00:12:34,814 --> 00:12:37,476 +It's all part of nature's, +you know, cycle. + +198 +00:12:37,550 --> 00:12:39,484 +Well, Jerry, you're a whale +of a lobbyist, and, uh... + +199 +00:12:39,552 --> 00:12:42,385 +I'd like to give you a logging permit, +I would, but, uh... + +200 +00:12:42,455 --> 00:12:44,787 +this isn't like +burying toxic waste. + +201 +00:12:44,857 --> 00:12:47,325 +People are gonna notice +those trees are gone. + +202 +00:12:49,061 --> 00:12:50,995 +Eh, Congressman, this is where +it gets awkward. + +203 +00:12:51,063 --> 00:12:55,500 +I— I never quite know +how to put this. + +204 +00:12:55,568 --> 00:12:57,502 +- I just want to— +- Offer me a bribe? + +205 +00:13:01,073 --> 00:13:03,541 +Oh, what is it? + +206 +00:13:03,609 --> 00:13:06,476 +It's that little girl from Springfield +who wrote the essay. + +207 +00:13:06,545 --> 00:13:08,376 +- Could be a good photo-op. +- Sure, fine. + +208 +00:13:08,447 --> 00:13:10,915 +- So, uh, where do we— +- Duh, duh, duh, Not here. + +209 +00:13:10,983 --> 00:13:15,920 +I've got a little place that +I use for these, uh, matters. +Call me tonight. + +210 +00:13:15,988 --> 00:13:20,220 +- Well, hi there. +You must be Lisa Simpson. +- Hello, sir. + +211 +00:13:20,292 --> 00:13:23,227 +Lisa, you're a doer, +and who knows, maybe someday... + +212 +00:13:23,295 --> 00:13:25,229 +you'll be a congressman +or a senator. + +213 +00:13:25,297 --> 00:13:27,026 +We have quite a few +women senators, you know. + +214 +00:13:27,099 --> 00:13:30,000 +Only two. I checked. + +215 +00:13:30,069 --> 00:13:32,731 +You're a sharp one. +Well, how about a few pictures? + +216 +00:13:35,040 --> 00:13:38,601 +Tot shot always plays +in the sticks. + +217 +00:13:38,677 --> 00:13:40,668 +Oh, isn't that nice? + +218 +00:13:40,746 --> 00:13:42,680 +Now there is +a politician who cares. + +219 +00:13:42,748 --> 00:13:46,445 +If I ever vote, +it'll be for him. + +220 +00:13:50,689 --> 00:13:52,850 +Mom? + +221 +00:13:52,925 --> 00:13:55,621 +Lisa, the contest +isn't for three hours. + +222 +00:13:55,694 --> 00:13:57,889 +I'm too excited to sleep. + +223 +00:13:57,963 --> 00:14:00,227 +Anyone up for the +Winifred Beecher Howe Memorial? + +224 +00:14:00,299 --> 00:14:02,859 +- Who's that? +- An early crusader for women's rights. + +225 +00:14:02,935 --> 00:14:05,961 +She led the Floor Mop +Rebellion of 1 91 0. + +226 +00:14:06,038 --> 00:14:09,132 +Later, she appeared on +the highly unpopular +75-cent piece. + +227 +00:14:09,208 --> 00:14:13,440 +Okay, but you don't know +what you're missing. + +228 +00:14:17,416 --> 00:14:19,680 +Oh! + +229 +00:14:19,752 --> 00:14:22,152 +"I will iron your sheets +when you iron out... + +230 +00:14:22,221 --> 00:14:24,348 +the inequities +in your labor laws." + +231 +00:14:24,423 --> 00:14:26,914 +Amen, sister. + +232 +00:14:26,992 --> 00:14:28,926 +I told you +no one ever came here. + +233 +00:14:28,994 --> 00:14:32,862 +So, Bob, where do we stand +on Springfield Forest? + +234 +00:14:32,932 --> 00:14:35,696 +Do I get my logging permit? + +235 +00:14:35,768 --> 00:14:39,704 +Well, let me put it +this way, Jerry. Timber! + +236 +00:14:44,810 --> 00:14:47,142 +- What a pooch. +- Woof woof! + +237 +00:15:01,296 --> 00:15:05,665 +How can I read my essay now? +I don't believe my own words. + +238 +00:15:09,738 --> 00:15:12,332 +Honest Abe— +he'll show me the way. + +239 +00:15:18,080 --> 00:15:20,708 +- Mr. Lincoln— +- Mr. Lincoln, +I need your advice. + +240 +00:15:20,783 --> 00:15:22,944 +What can I do to make this +a better country? + +241 +00:15:23,018 --> 00:15:24,952 +Is this a good time +to buy a house? + +242 +00:15:25,020 --> 00:15:27,887 +- I can't get my boy to brush. +- Would I look good +with a mustache? + +243 +00:15:27,956 --> 00:15:31,187 +I tried using turpentine, +but that just made it worse. + +244 +00:15:33,629 --> 00:15:36,189 +Mr. Lincoln? +Mr. Lincoln? + +245 +00:15:36,265 --> 00:15:40,224 +My name is Lisa Simpson, +and I have a problem! + +246 +00:15:43,305 --> 00:15:46,035 +Mr. Jefferson, +my name is Lisa Simpson... + +247 +00:15:46,108 --> 00:15:48,406 +- and I have a problem. +- I know your problem. + +248 +00:15:48,477 --> 00:15:50,570 +The Lincoln Memorial +was too crowded. + +249 +00:15:50,646 --> 00:15:53,581 +- Sorry, sir. It's just— +- No one ever comes to see me. + +250 +00:15:53,649 --> 00:15:56,516 +I don't blame them. +I never did anything important— + +251 +00:15:56,585 --> 00:15:58,576 +just the Declaration +of Independence... + +252 +00:15:58,654 --> 00:16:01,145 +the Louisiana Purchase, +the dumbwaiter— + +253 +00:16:01,223 --> 00:16:03,589 +Maybe I should be going. +I caught you at a bad time. + +254 +00:16:03,659 --> 00:16:07,425 +Wait! Please don't go. +I get so lonely. + +255 +00:16:27,850 --> 00:16:31,149 +The truth must be told. + +256 +00:16:35,491 --> 00:16:39,018 +Oh.! Oh.! Oh.! Oh.! + +257 +00:16:39,094 --> 00:16:41,722 +Rudy, my man, +you're a miracle worker. + +258 +00:16:41,797 --> 00:16:44,630 +Your laundry, sir. + +259 +00:16:44,700 --> 00:16:46,691 +There you go. +Buy yourself something nice. + +260 +00:16:46,768 --> 00:16:50,761 +- Thank you. +- Bart, are you ready to +go to— + +261 +00:16:50,839 --> 00:16:52,864 +- I'll room service you.! +- Before you kill me... + +262 +00:16:52,941 --> 00:16:55,341 +remember, this trip +is all expenses paid. + +263 +00:17:11,760 --> 00:17:15,025 +- Thank you. +- Oh, this guy is awful. + +264 +00:17:15,097 --> 00:17:17,031 +I know, honey, +but just sit still. + +265 +00:17:18,500 --> 00:17:21,435 +Welcome, everyone, +to the awards luncheon. + +266 +00:17:21,503 --> 00:17:24,165 +I'd like to introduce +our distinguished judges... + +267 +00:17:24,239 --> 00:17:26,298 +who will select +our scholarship winner. + +268 +00:17:26,375 --> 00:17:29,708 +Former Redskins great +Alonzo Flowers... + +269 +00:17:29,778 --> 00:17:32,770 +perennial third-party candidate +Wilson DeFarge... + +270 +00:17:32,848 --> 00:17:35,146 +Senate page Brad Fletcher... + +271 +00:17:35,217 --> 00:17:37,447 +skin care consultant Rowena... + +272 +00:17:37,519 --> 00:17:41,216 +and wealthy gadabout +Chilton Gaines. + +273 +00:17:41,290 --> 00:17:45,386 +Our first essayist +will be Lisa Simpson. + +274 +00:17:45,460 --> 00:17:48,952 +Lisa? Lisa? + +275 +00:17:49,031 --> 00:17:53,058 +Oh, there she is. + +276 +00:17:53,135 --> 00:17:55,831 +Lisa Simpson +will now read her essay— + +277 +00:17:55,904 --> 00:17:58,896 +I would like to read +a different essay, if I may? + +278 +00:17:58,974 --> 00:18:01,204 +Um— Okay. + +279 +00:18:03,345 --> 00:18:06,439 +The city of Washington was built +on a stagnant swamp... + +280 +00:18:06,515 --> 00:18:10,474 +some 200 years ago +and very little has changed. + +281 +00:18:10,552 --> 00:18:13,544 +It stank then +and it stinks now. + +282 +00:18:13,622 --> 00:18:17,786 +Only today, it is +the fetid stench of corruption +that hangs in the air. + +283 +00:18:17,859 --> 00:18:20,521 +Cool! A ruckus. + +284 +00:18:23,198 --> 00:18:25,962 +And who did I see +taking a bribe... + +285 +00:18:26,034 --> 00:18:28,525 +but the honorable +Bob Arnold. + +286 +00:18:28,604 --> 00:18:31,072 +But don't worry, Congressman... + +287 +00:18:31,139 --> 00:18:35,269 +I'm sure you can buy +all the votes you need +with your dirty money. + +288 +00:18:35,344 --> 00:18:39,110 +And this will be one nation +under the dollar... + +289 +00:18:39,181 --> 00:18:42,514 +with liberty +and justice for none. + +290 +00:18:47,656 --> 00:18:50,056 +Senator, there's a problem +at the essay contest. + +291 +00:18:50,125 --> 00:18:52,559 +- Please, son, I'm very busy. +- A little girl... + +292 +00:18:52,628 --> 00:18:55,688 +- is losing faith in democracy. +- Good Lord! + +293 +00:19:00,402 --> 00:19:04,338 +Congressman, we want to drill for +oil in Teddy Roosevelt's head. + +294 +00:19:04,406 --> 00:19:07,842 +Well— Teddy who? + +295 +00:19:07,909 --> 00:19:10,537 +Congressman... + +296 +00:19:10,612 --> 00:19:12,546 +you're under arrest. + +297 +00:19:16,518 --> 00:19:19,146 +- You work fast. +- I work for Uncle Sam. + +298 +00:19:21,890 --> 00:19:25,621 +We will now vote +on the House bill 1022— + +299 +00:19:25,694 --> 00:19:27,525 +the expulsion of Bob Arnold. + +300 +00:19:27,596 --> 00:19:31,555 +Mr. Speaker, I'm all for the bill, +but shouldn't we tack on... + +301 +00:19:31,633 --> 00:19:34,397 +- a pay raise for ourselves? +- No.! + +302 +00:19:38,073 --> 00:19:41,167 +Okay, this should make +my bosses very happy. + +303 +00:19:41,243 --> 00:19:46,408 +- Your bosses? +- Yep. All 250 million of them. + +304 +00:19:49,451 --> 00:19:51,976 +When my family arrived +in this country four months ago... + +305 +00:19:52,054 --> 00:19:54,887 +we spoke no English +and had no money in our pockets. + +306 +00:19:54,956 --> 00:19:59,086 +Today, we own a nationwide chain +of wheel-balancing centers. + +307 +00:19:59,161 --> 00:20:02,392 +Where else but in America— +or possibly Canada— + +308 +00:20:02,464 --> 00:20:05,365 +could our family find +such opportunity? + +309 +00:20:05,434 --> 00:20:08,096 +That's why whenever I see +the stars and stripes... + +310 +00:20:08,170 --> 00:20:12,197 +I'll always be reminded +of that wonderful word "flag." + +311 +00:20:14,276 --> 00:20:17,541 +There will be a brief recess +while the judges tabulate their votes. + +312 +00:20:17,612 --> 00:20:20,206 +Lisa, what's +gotten into you? + +313 +00:20:20,282 --> 00:20:23,046 +Yeah, your other speech +was a little more crowd pleasing. + +314 +00:20:23,118 --> 00:20:27,885 +I'm sorry, Dad. +I couldn't think of a nice way +to say America stinks. + +315 +00:20:27,956 --> 00:20:31,016 +Extra! Extra! +Feds nab rotten rep. + +316 +00:20:31,093 --> 00:20:33,027 +Give me one of those. + +317 +00:20:33,095 --> 00:20:37,191 +"Imprisoned congressman +becomes born-again Christian. " + +318 +00:20:37,265 --> 00:20:41,031 +I can't believe it. +The system works. + +319 +00:20:46,942 --> 00:20:50,343 +- He already sang this song. +- No, that was about the budget gap. + +320 +00:20:50,412 --> 00:20:52,039 +This is the trading gap. + +321 +00:20:53,482 --> 00:20:55,882 +And now +the moment of truth. + +322 +00:20:55,951 --> 00:21:00,684 +Will the winning essay be +" Bubble on, O melting pot"? + +323 +00:21:00,756 --> 00:21:03,657 +"Lift high your lamp, +Green Lady"? + +324 +00:21:03,725 --> 00:21:06,558 +"USA, A-OK"? + +325 +00:21:06,628 --> 00:21:09,256 +Or "Cesspool on the Potomac"? + +326 +00:21:09,331 --> 00:21:12,300 +Cesspool! Cesspool! Cesspool! +Cesspool! Cesspool! + +327 +00:21:12,367 --> 00:21:14,801 +And now the winner is... + +328 +00:21:14,870 --> 00:21:18,101 +" USA, A-OK," +by Trong Van Dinh. + +329 +00:21:18,173 --> 00:21:20,403 +D'oh! + +330 +00:21:23,111 --> 00:21:26,239 +Miss Crowley, thank you +for this oversized novelty check. + +331 +00:21:26,314 --> 00:21:29,841 +I would like share this honor +with all of my fellow essayists... + +332 +00:21:29,918 --> 00:21:32,887 +particularly +the courageous Lisa Simpson... + +333 +00:21:32,954 --> 00:21:35,149 +whose inflammatory +rhetoric reminded us... + +334 +00:21:35,223 --> 00:21:38,715 +that the price of freedom +is eternal vigilance. + +335 +00:21:38,794 --> 00:21:41,888 +Give her the check! + +336 +00:21:41,963 --> 00:21:43,954 +I was serious. + +337 +00:21:57,445 --> 00:21:59,913 +- Ow.! +- Bart! + +338 +00:21:59,981 --> 00:22:03,439 +Lis, you taught me to stand up +for what I believe in. + +339 +00:22:52,712 --> 00:22:54,646 +Shh! + diff --git a/tests/subliminal_patch/test_mods.py b/tests/subliminal_patch/test_mods.py new file mode 100644 index 000000000..f742b1c0e --- /dev/null +++ b/tests/subliminal_patch/test_mods.py @@ -0,0 +1,16 @@ +import pytest +import os +from subliminal_patch import Subtitle + + +@pytest.fixture +def test_file(data): + return os.path.join(data, "subs_for_mods.srt") + + +def test_apply_mods_remove_hi(languages, test_file): + sub = Subtitle(languages["en"], mods=["remove_HI", "OCR_fixes"]) + with open(test_file, "rb") as f: + sub.content = f.read() + + assert sub.get_modified_content(debug=True)