Tropes
The page is a list of names
Affably Evil and Faux Affably Evil barely overlap as strings. They still describe the same kind of person: pleasant on the surface, cruel underneath.
Discover similar characters across TV shows and media
Two characters can share a personality and still miss each other when the match is only the trope name. Each person is placed in a vector of 637 traits, and similarity is how close those vectors are.
Tropes
Affably Evil and Faux Affably Evil barely overlap as strings. They still describe the same kind of person: pleasant on the surface, cruel underneath.
Traits
Each trope lights a few slots. Deadpan Snarker turns on impassive and sarcastic. Anti-Hero turns on cynical, with a little heroic. “Evil” counts as cruelty once, not as every harsh synonym.
Neighbors
The cosine of those vectors is computed when the site is built. Rare traits are ignored. Very common ones, such as cruelty, stay at a lower weight so they connect people without making every villain identical.
If a character’s tropes never resolve to at least three traits, the page falls back to overlap of the trope names.
A list of remarks that describe the process of learning and improvement that occurred during the creation of this project.
Challenges
TV Tropes is the right source for this, and it is not a table of characters. A show page is usually a hub that links out to team pages and character pages. One person is often split into alphabetical folders such as A–B and C–E. Those folders are groups of tropes. The first parser saved each folder as its own character, so Walter White arrived as a stack of letter ranges instead of one man with 545 tropes.
The addresses are a second puzzle. Slugs are CamelCase, a leading “The” belongs in the name, and a digit has to be spelled or the page 404s. 24 is TwentyFour. 2 Broke Girls is TwoBrokeGirls. King of Queens exists only as TheKingOfQueens. An early crawl retried every missing URL and was on pace to run most of a day. Returning on the first 404, checking fewer namespaces, and skipping files already saved is what let a full pass finish.
The third failure showed up after the files looked complete. Jaccard similarity is shared tropes divided by the combined set, so a long list can share dozens of tropes and still score very small, because the union is huge. The page used to compare a character with the first 500 others and demand more than 5% overlap. Walter White never cleared that bar. The mirror image is a lead like Dr. House, whose show spent years adding quirks. He shares a little with almost everyone, and an unfiltered score seats him next to people he does not resemble.
Design decisions
Matching on the trope name is literal. Affably Evil and Faux Affably Evil barely overlap as strings, and they describe a similar person: pleasant on the surface, cruel underneath. Deadpan Snarker and a sarcastic stoic can miss each other for the same reason.
The trait list is 637 personality words. Each character gets one vector with a slot for every word. A trope is translated from its own words: Deadpan Snarker turns on impassive and sarcastic, Anti-Hero turns on cynical with a little heroic. One word does not light every synonym, so “evil” counts as cruelty once. A trope that merely contains a trait-shaped word, such as Criminal, is not treated as evidence of that trait.
The score is the cosine of those vectors, computed when the site is built. Eight neighbors are kept. Traits that almost never appear are ignored. Very common ones stay in the vector at a lower weight, so cruelty can still connect two people without making every villain identical. When a character’s tropes never resolve to at least three traits, the page falls back to overlap of the trope names.
The same name belongs to more than one person, so the index is a list and a card opens by id. Letter-bucket folders are merged back into the character named in the page title. Fandom listed people without tropes, and Reddit never produced a signal stable enough to combine with this one, so the live catalog is TV Tropes alone.
Outcomes
The index holds 46,244 characters across 1,115 shows. The original plan was a few hundred shows. Pages that were only a letter range of tropes, or a heading like “in general,” are left out. Two titles for the same series can both survive.
Walter White’s vector comes out deceitful, heroic, scheming, and intelligent, with cruelty just behind. The neighbors are Lex Luthor, Rick Sanchez, Eric Cartman, and Gustavo Fring. Cartman is the one that shows the layer working: the shared part is cruelty and deceit, without requiring the same trope names. Gus is the same show, which the traits also catch. Tony Soprano sits closer to Hannibal Lecter and Junior Soprano: possessive, callous, and cruel, with less of Walter’s heroic self-image.