For years, the quotation “The opera ain’t over until the fat lady sings” was attributed to sportscaster Dan Cook.

Then Fred Shapiro, associate librarian for collections and access services at the Yale Law School, came on the scene, and — using extensive online databases and newspaper archives — traced the saying back to Ralph Carpenter, a sports information director at Texas Tech University in the 1970s. Carpenter, Shapiro found, had used the phrase at a basketball game against Texas A & M University two years before Cook said it in a television broadcast.

“There’s a lot of quotes [where] their origins are not clear cut,” Shapiro said. “[But] if you search these databases you can push a quote back to the earliest time it was mentioned in a newspaper article.”

Shapiro has researched thousands of quotations to compile the Yale Book of Quotations, a dictionary-sized collection of famous sayings published earlier this month by Yale University Press. Shapiro spent six years working on the book, mostly in his spare time on evenings and weekends, and in the process pushed the origins of some quotations back decades or even centuries from their previously established first uses. Shapiro said his book is intended to compete with better-known quotation reference books such as Bartlett’s Familiar Quotations and the Oxford Dictionary of Quotations.

“It brings a lot to the table that these other books don’t have,” Shapiro said. “It has good chance of becoming a standard reference work.”

Shapiro said his book fills a void in the reference world, as neither Bartlett’s nor the Oxford Dictionary of Quotations have been significantly updated for years, and both lack quotations about contemporary subjects such as popular culture, computers and professional sports.

For example, Shapiro said, neither of his competitors include baseball player Lou Gehrig’s statement, “Today I consider myself the luckiest man on the face of the earth,” from a speech he made to the Yankees and their fans shortly after he announced he was dying.

“That’s not in Bartlett’s or the Oxford Dictionary of Quotations, even though it’s probably one of most famous quotes in American sports,” Shapiro said.

The quotations he included in the Yale Book of Quotations were chosen mostly based on their fame, Shapiro said, although in some cases he exercised professional discretion and included lesser-known quotations as well, as long as they were particularly eloquent or witty.

Law librarian Blair Kauffman said Shapiro’s work on the Yale Book of Quotations reflects his strengths as a librarian.

“You have to be a certain kind of scholar to do this work, but Fred gets into it with gusto,” he said. “You have to have passion to be successful, and he’s got it.”

Shapiro traces his interest in quotations as far back as his years at the Massachusetts Institute of Technology, where as an undergraduate he edited a quotations feature on the back page of a student newspaper. His interest expanded in the early 1990s, he said, when he worked on the Oxford Dictionary of American Legal Quotations. But he did not begin real research for the Yale Book of Quotations until 2000, when he finalized his book deal with Yale University Press. Unlike many people who undertake similar projects, Shapiro said he did not spend his whole life writing down quotations on index cards and thus had to start building his collection once he started working on the book.

Despite Shapiro’s late start, Morris Cohen, an emeritus professor of law and former librarian at the Law School, said the Yale Book of Quotations was a natural outgrowth of interests Shapiro has pursued for years. Cohen recalled one instance where Shapiro traced the origins of the legal phrase “due process” and pushed back its recorded first use in the Oxford English Dictionary.

“He found a usage that was maybe 100 years earlier,” Cohen said. “He loves to do that. He loves to stump the experts.”

Shapiro also practices in the field of legal citology, which provides a way to measure the popularity of a work or scholar by tracking the number of times a citation of his or her work appears in other articles or books. Robert Ellickson, a professor at the Law School who has done citology work with Shapiro, said Shapiro is a pioneer in the field.

“We call him a world-class scrounge,” Ellickson said. “He’s very good at tracking down obscure things.”

Shapiro did most of the research for the Yale Book of Quotations himself, using powerful online newspaper search engines such as ProQuest and NewspaperArchive and JSTOR, an online collection of scholarly articles. A worldwide network of research librarians on the listserv Stumpers also helped him trace the origins of particularly tricky quotes. Shapiro said he could not have compiled the book any earlier because the necessary technology did not exist.

Thomas Fuller, an international tax attorney from Washington, D.C., met Shapiro through Stumpers and eventually became one of 12 voluntary research assistants around the country who helped Shapiro verify quotations for the book. Fuller spent countless unpaid hours — just “for the fun of it” — searching for obscure origins in libraries throughout the D.C. area. He said Shapiro’s book is remarkable because unlike Bartlett’s or the Oxford Dictionary of Quotations, the origin of every entry has been meticulously researched and traced back to a specific source.

“It’s the kind of thing where after its done once right nobody ever has to do it again,” Fuller said.

Shapiro said his favorite part about compiling the Yale Book of Quotations was the sense of rediscovering the past.

“That’s the most satisfying part of it,” he said. “When you talk about origins of things, particularly words and quotations, it’s all folklore and mythology … I enjoy being able to prove you can find the truth when everyone thinks it’s all lost in the mists of time.”