-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwordmap.py
More file actions
135 lines (131 loc) · 4.22 KB
/
wordmap.py
File metadata and controls
135 lines (131 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
"""
Inspired by and built on top of:
https://www.explainxkcd.com/wiki/index.php/1288:_Substitutions
https://www.explainxkcd.com/wiki/index.php/1625:_Substitutions_2
https://www.explainxkcd.com/wiki/index.php/1679:_Substitutions_3
"""
# TODO: refactor these to be in RegEx form to prevent matches being found WITHIN certain words
# (e.g., prevent cases like "disruption" -> "destroyion")
WORD_MAP = {
"witnesses": "these dudes I know",
"allegedly": "kinda probably",
"new study": "tumblr post",
"rebuild": "avenge",
"space": "spaaace",
"google glass": "virtual box",
"smartphone": "Pokédex",
"electric": "atomic",
"senator": "elf-lord",
" car ": " cat ",
"-car ": "-cat ",
" car.": " cat.",
" cars ": " cats ",
"-cars ": "-cats ",
" cars.": " cats.",
"-cars.": "-cats.",
"election": "eating contest",
"congressional leaders": "river spirits",
"homeland security": "homestar runner",
"could not be reached for comment": "is guilty and everyone knows it",
"debate": "dance-off",
"self-driving": "uncontrollably swerving",
# "poll": "psychic reading",
" poll ": " psychic reading ",
" poll": " psychic reading",
"candidate": "airbender",
"drone": "dog",
"vows to": "probably won't",
"at large": "very large",
"successfully": "suddenly",
"expands": "physically expands",
"first-degree": "friggin' awful",
"second-degree": "friggin' awful",
"third-degree": "friggin' awful",
"an unknown number": "like hundreds",
"front runner": "blade runner",
"global": "spherical",
"year": "minute",
"minute": "year",
"no indication": "lots of signs",
"urged restraint by": "drunkenly egged on",
"horsepower": "tons of horsemeat",
"gaffe": "magic spell",
"ancient": "haunted",
"star-studded": "blood-soaked",
"remains to be seen": "will never be known",
"silver bullet": "way to kill werewolves",
"subway system": "tunnels I found",
"surprising": "surprising (but not to me)",
"war of words": "interplanetary war",
"tension": "sexual tension",
"cautiously optimistic": "delusional",
"doctor who": "the Big Bang Theory",
"win votes": "find pokemon",
"behind the headline": "beyond the grave",
"email": "poem",
"facebook post": "poem",
"tweets": "screams into a pillow",
"tweet": "poem",
"facebook ceo": "this guy",
"Jeff Bezos": "a hot single in your area",
"latest": "final",
"disrupt": "destroy",
# "meeting": '',
"scientists": "Channing Tatum and his friends",
"scientist": "Channing Tatum",
"you won't believe": "I'm really sad about",
# Additional
"immigrants": "people",
"migrants": "people",
"police": "30-50 Feral Hogs",
"Netflix": "Quibi",
"Quibi": "Netflix",
"international": "local",
"local": "international",
"donation": "bribe",
"GoFundMe": "American Healthcare",
"hundreds": "like...two (max)",
"millions": 'an incalculable amount',
"million": '',
"billionaire": "oligarch",
"billion": 'dozen',
"students": "literal children",
# "hackers": "keyboard warriors", # "clickity-clackity hackybois
"hackers": "clickity-clackity hackybois",
"Florida": "Depths of Hell",
"abortion": "bodily autonomy",
"Apple": "Nokia",
"world": "neighborhood",
"FBI": "Codename Kids Next Door",
"interview": "heart-to-heart",
"database": "diary",
"monkeypox": "baby fever",
"Kavanaugh": "Beer Enjoyer",
"member": "fan",
"Elon Musk": "Grimes\' ex",
"gasoline": "weed",
"gas ": "weed ",
" gas ": " weed ",
" gas": " weed",
"breaking news": "HOLY SHIT",
"yacht": "canoe",
"former": "disgraced",
"committee": "fanclub",
"restaurants": "Denny\'s",
"restaurant": "Denny\'s",
"GOP": "antifa",
"antifa": "GOP",
"Facebook": "Webkinz",
"book": "audiobook"
}
"""
These are the terms that map to each other in the replacement filter (see wordmap.py)
Keep track of these to avoid re-/un-mapping these terms (which would result in a net-zero change to the text)
"""
WORDMAP_SWAP_CASES = {
"years", "minutes",
"Netflix", "Quibi",
"international", "local",
"year", "minute",
"GOP", "antifa"
}