Ever thought two books felt nearly identical? The déjà vu isn’t in your head.

Researchers from University of Vermont mapped the sentimental fluctuations of over 1,700 books. By tracing the emotional changes in the stories, they noticed an overall arc for each novel. They found that the emotional tone of most novels falls into six distinct brackets:

“Rags to riches”: Steady rise

“Riches to rags” or “Tragedy”: Steady Fall

“Man in a hole”: Fall-Rise

“Icarus”: Rise-Fall

“Cinderella”: Rise-Fall-Rise

“Oedipus”: Fall-Rise-Fall

Each novel can have its unique complex plots and structures, but the emotional journey slots specific stories into these categories, the researchers indicate. This is easy to see: Typically, most superheroes will fall in the “Man in a hole” category while villains will follow the opposite trajectory, much like the “Icarus” scenario, regardless of their plots.

“Personally, stories are just fascinating. We use them everyday to define our identity, and Vonnegut’s original thesis was an inspiration for this work,” lead researcher Andrew Reagan said. The researchers paid an ode to the Slaughterhouse-Five writer in their study: ”Vonnegut finds a remarkable similarity between Cinderella and the origin story of Christianity in the Old Testament, leading us to search for all such groupings.”

Study A “Rags to Riches” story of sorts

To find these patterns, the researchers selected English books between 10,000 and 200,000 words that had more than 150 downloads from the Project Gutenberg website, a free ebook service. They also filtered out dictionaries and transcriptions by the Human Genome Project.

Then, they created graphs as they slid a 10,000 word window through each text, taking the average happiness of each “bag of words” and rating each one according to the LabMT sentiment dictionary. Graphs of Romeo and Juliet and other works are available online.

Artificial intelligence has already managed to pen down movie scripts, write romantic poetry, and write a novel that passed the first round of a Japanese literary competition. Maybe an emotional novel is next on the cards. “Our approach could applied in the opposite direction: namely by beginning with the emotional arc and aiding in the automatic generation of compelling stories,” the researchers write in the study.

In the future, Reagan wants to do a finer grained analysis to capture all the emotions around single sentences, since the sliding window was too big to take into account all brief moments. He hopes they will be able to compare plot trajectories too.

What’s Reagan’s favorite emotional rollercoaster? “I always enjoy a good underdog story, which can correspond to a “Rags to riches” emotional arc.”