hacker has asked for the wisdom of the Perl Monks concerning the following question:
He found me, because I suggested a project to convert all of Project Gutenberg to Plucker format, in a professional, scalable, automated fashion.
The combined talents of a "Professional Screen Scraper" and a Linguist, would be ideal here, which is how the two of us managed to hook up on this project.
But we ran into a snag.. there is ZERO consistency in the Project Gutenberg etexts, after editing them by hundreds of volunteers, each with their own ideas. Project Gutenberg's Distributed Proofreaders is a good first step, but it isn't quite there yet.
How does this relate to Perl? Well, that would be our engine, to roll through each book, unzip it, catalog it, store it in MySQL, and output it into a format we can grok with other tools.
Our first step is to take the Gutenberg Master Index, and parse it for the title, filename, document number, and so on, to populate the initial tables in the database. From there, we'll query the db and fetch each ebook in succession to perform our tests, analysis, import, and conversion of the documents.
But we're stuck on the index. The only thing that seems to remain constant in there, is the document number, a 5-digit number in the right-most column. It is always at the end of the very first line of text describing a new book entry.
What is the best way to approach parsing this? I don't even know where to begin to scan this file for the right textual members in a way that doesn't overlap another previous or following entry, during our import.
I've seen the Glossarymaker and this entry from SpritusMaximus, but neither of them seem to do what we need.
Pseudo-examples or real examples we can use as a starting point would be great. Thanks again, everyone.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Parsing Gutenberg Catalog Index
by kvale (Monsignor) on Aug 30, 2004 at 05:30 UTC | |
by Anonymous Monk on Aug 30, 2004 at 06:37 UTC | |
by tachyon (Chancellor) on Aug 30, 2004 at 07:58 UTC | |
by lidden (Curate) on Aug 30, 2004 at 12:08 UTC | |
by GotToBTru (Prior) on Mar 14, 2016 at 12:58 UTC | |
Re: Parsing Gutenberg Catalog Index
by PodMaster (Abbot) on Aug 30, 2004 at 05:46 UTC | |
Re: Parsing Gutenberg Catalog Index
by DrHyde (Prior) on Aug 31, 2004 at 08:00 UTC | |
by Anonymous Monk on Mar 13, 2016 at 20:08 UTC | |
by DrHyde (Prior) on Jan 11, 2017 at 17:23 UTC |