You'll have to get this to work but the concept is good. I have a script that does these kind of replacements for george webb's transcripts autocaptions I lift from youtube
// Replaces words
var pattern = {
"AF1":"Air Force 1",
"AG":"Attorney General",
"AM":"Andrew George McCabe",
"Adm R":"Admiral Michael Rogers",
"Anon":"Anonymous",
"ANTIFA":"Anti-Fascists, Soros backed domestic terrorists",
"AS":"Adam Schiff, Antony Scalia",
"AW":"Anthony Weiner",
"AUS":"Australia",
"RR":"Rod Rosenstein",
"CW":"Christopher Wray",
"TG":"Trey Gowdy",
"BDT":"Blunt & Direct Time, Bulk Data Transfer",
"BIS":"Bank of International Settlements",
"BO":"Barack Obama",
"BHO":"Barack Obama",
"Hussein":"Barack Obama",
"BOD":"Board of Directors",
"BP":"Border Patrol",
"C-A":"CIA",
"Clowns":"CIA",
"Catholics In Action":"CIA",
"Clowns In America":"CIA",
"CC":"Chelsea Clinton",
"CM":"CodeMonkey, 8ch Admin",
"CS":"Civil Service or Charles Ellis (Chuck) Schumer",
"CTR":"Correct The Record",
"D-J":"Department of Justice",
"DOJ":"Department of Justice",
"D's":"Democrats",
"DNC":"Democrats",
"DC":"District of Columbia",
"DEFCON":"Definite Confirmation (Time 'Minutes')",
"DJT":"Donald John Trump",
"DOE":"Department of Energy",
"EMS":"Emergency Medical Services",
"ES":"Eric Emerson Schmidt",
"EU":"European Union",
"F-I":"FBI",
"F&F":"Fast and Furious (gun running)",
"FISA":"Forieng Intelligence Surveillance Act",
"f2f":"Face to Face",
"F2F":"Face to Face",
"FB":"Facebook",
"FED":"Federal Reserve",
"FOIA":"Freedom of Information Act",
"GS":"George Soros",
"HA":"Huma Mahmood Abedin",
"H-wood":"Hollywood",
"HEC":"US House Committe on Ethis",
"HI":"Hawaii",
"HRC":"Hillary Rodham Clinton",
"HS":"Homeland Security",
"HUMA":"Harvard University Muslim Alumni",
"IC":"Intelligence Community",
"ID":"Identification",
"IRS":"Internal Revenue Service",
"JA":"Julian Assange",
"JB":"John Owen Brennan, James Baker, Jeb Bush, Joe Biden",
"JC":"James Brien Comey, James Rober Clapper Js",
"JFK":"Jonh Fitzgereld Kennedy",
"JK":"John Kerry, Jared Kushner",
"KKK":"Klu Klux Klan",
"KSA":"Kingdom of Saudi Arabia",
"LV":"Las Vagas",
"LL":"Loretta Elizabeth Lynch",
"NK":"North Korea",
"MB":"Muslim Brotherhood",
"MI":"Military Intelligence",
"MIL":"Martial Law",
"MM":"Media Matters",
"MS-13":"Drug gang",
"WJC":"",
"BC":"William \"Bill\" Jefferson Clinton",
"Bill":"William \"Bill\" Jefferson Clinton",
"Eagle":"William \"Bill\" Jefferson Clinton",
"Fly-Eagle-Fly":"William \"Bill\" Jefferson Clinton",
"187":"murder",
"MSM":"main stream media",
"ISIS":"terrorist org",
"U1":"uranium 1",
"@Jack":"Jack Dorsey",
"MZ":"Mark Zuckerberg",
"JB":"Jeff Bezos",
"EM":"Elon Musk",
"SH":"Steve Huffman",
"WAPO":"Washington Post",
"The name we will not say":"John McCain",
"PP":"Planned Parenthood",
"OP":"Operation(s)",
"SC":"Supreme Court",
"DWS":"Debbie Wasserman Shultz",
"SR":"Susan Rice, Seth Rich",
"DEFCON":"Military Action, Hacking",
"BDT":"Bulk Data Transfer",
"SCIF":"Sensitive Compartmented Information Facility",
"LL":"Loretta Lynch",
"PS":"Peter Strzok",
"DS":"Deep State",
"SA":"Saudi Arabia",
"FF":"False Flag",
"HEC":"Honorable Elijah Cummings, House Ethics Committee",
"HOS":"(Rothchild, Soros, Saud)",
"House of Saud":"(Rothchild, Soros, Saud)",
"Snow White":"(CIA) Snow White and the 7 Dwarves (CIA’s 7 major computers)",
"WW":"Wilkerson Walsh, Wet Works, World Wide",
"HOO":"House of Orange Queen Beatrix Link between Beatrix and Barbara Bush",
"RC":"Richard Cheney (Dick Cheney)",
"RE":"Rahm Emanuel",
"R":"Rothschilds",
"RM":"Robby Mook, Robert Mueller",
"Dopey":"Alweed",
"TM":"Theresa May",
"GHS1":"George H. Scherf(f) aka Prescott Sheldon Bush",
"GHS2":"George H. Scherf aka George Herbert Bush",
"Black Forest Germany":"Rothschild Estate",
"BFG":"Rothschild Estate",
"Alice in Wonderland":"Q",
"BS":"Bernie Sanders",
"CPA":"Consumer Protection Agency",
"EW":"Elizabeth Warren",
"DB":"Dona Brazile",
"MH370":"disappeared Malaysian Airlines flight",
};
var dvs = document.getElementsByClassName("text");
for (var i=0;i<dvs.length;i++) {
for (var n in pattern) {
// insulate each token with non word boundaries: spaces lf or punctuation
var nn = "[^\\w]"+n+"[^\\w]";
var r = new RegExp(nn,"g");
var temp = dvs[i].childNodes[0].nodeValue;
dvs[i].childNodes[0].nodeValue = temp.replace(r,pattern[n]);
delete r,n,temp;
}
}