More of what the pages around a title page carry: a dedication naming
somebody ("For Tom, Burney, and Bruce", "TO JILL PREWETT AND"), the
headings of the pages before the text ("ENDORSEMENTS", "About the
Authors", "Books by ...", "Author's Preface", "CHAPTER ONE"), printing
and edition lines, the author's moral-rights line, a Library of
Congress control number, an ebook's or a scanner's note ("digitized",
"with funding from"), a publisher's address ("P.O. Box", "a division
of"), award lines, and "visit us online". The longer printing of a
title read off the title page is no longer allowed to be one of them.
Over the front matter of 5,551 books, against the catalogue's titles:
titles that agree 2,669 -> 2,665, that disagree 560 -> 508. The four
no longer read were praise pages that happened to name the book.
"A Novel", "A History", "A Psychoanalytic View" were read as people
with the initial A. Over the front matter of 5,551 books: 14 fewer
wrong names, no right one lost (precision 85.9% -> 86.7%). A rule
dropping any name made of the title's own words was tried and left
out: it also dropped real authors named in their titles ("Isaac Newton:
Philosophical Writings").
The cataloguing block's statement of responsibility was split into
names and every short piece kept: "edited by" on its own, "translated
from the French", "Greg Palast. p. cm", "Irving B. Weiner;
editor-in-chief", "ISSN 0920-". Now the statement stops at the physical
description and the identifiers, roles before the names decide whose
they are ("selected and edited by", "[edited by]", "translated from"
skipped), a role after a name makes it an editor, an edition statement
after the names comes off, and each name has to pass bibclean's test of
a person's name, with two words or a known single name.
The title page's byline goes through the same test, so a series name or
a line of the title set in capitals beside the author ("MARESFIELD
LIBRARY", "A BASIC THEORY OF", "WISDOM'S Journey") is not taken for one.
Over the front matter of 5,551 books, against the catalogue's authors:
names read that agree 1,368 -> 1,320, that disagree 379 -> 217;
precision 78% -> 86%. The agreeing names no longer read were first
names standing alone ("Charlotte", "Alex").
html_entity (weight 2): "Master & Apprentice", left by a web page
the record was copied from. The named references a catalogue meets and
every numeric one are decoded first, before any rule reads the text; a
bare ampersand is left alone. Nine titles in a 6,022-record catalogue.
An author group is one person under several spellings, and in a
catalogue built from downloads the commonest spelling is often the
worst: "G.W.F. Hegel" on five books against "G. W. F. Hegel" on three,
"Saint Thomas (aquinas)", "S.J. Frederick Copleston", "Fyodor.
Dostoyevsky". Keeping it spreads it over every book in the group.
Author headings are now ranked by form first and by count only after:
a heading turned round (unless a suffix follows the comma), with a
bracket, a dangling separator, a suffix in front, or in capitals loses
to one without, however few books carry it; then stray full stops and
run-together initials. Respellings that are all well formed still go to
the commonest, so "Dostoëvsky" still merges into "Dostoevsky".
Publishers and subjects are ranked as before.
seriesof gains the numbered method: "Known Space-038-The Soft Weapon",
"Ice and Fire 2 - A Clash of Kings", "James Bond - 032 - Blast from the
Past" give the series, the number and the title without them. The
number has to stand between separators on both sides, so "The 200-Year
Plot", "The 12-Month Gardener" and "C.350-C.1450" stay titles. It is
looked for before a volume marker, so "Known Space-017-The Ethics of
Madness (Part 1)" is number 17 of Known Space and keeps its "Part 1".
bibclean names and repairs two more: numbered_title, a bare number in
front ("01 - The Three Musketeers", at most 200, so "911 - ..." and a
year stay), and release_tags after the title ("(BD) (v4 0) (lit)",
"(Scan, OCR)", "(no OCR)").
Over a 6,022-record catalogue: 73 numbered titles across Known Space,
Ice and Fire, James Bond, Wild Cards and Time Odyssey; 12 bare numbers;
4 sets of release tags. None wrong.
A page listing the other titles in a series prints each of their ISBNs
once, often before the copyright page, and was being taken for the
copyright page; the first ISBN read was then another book's. ISBNs are
now ranked over the whole front matter by how often they are printed
(the book's own appears in its cataloguing block and again on its
copyright line), the order printed breaking a tie, and the cataloguing
block's sorted list gives way to that ranking.
What is printed after an ISBN ("vol. 2", "hardback", "pbk.") is kept as
a note, and when the book's own title names a volume, the ISBN whose
note names the same volume comes first.
Over 398 books with printed ISBNs: three Cambridge Companions that read
another Companion's ISBN now read their own; eight more swap one
edition of the same book for another; nothing else changes.
url_title (weight 4): a title that is an http, file or www address. The
underscore repair no longer runs on an address or a path, where it
turned "stranger_than_fiction.htm" into "stranger than fiction.htm"
and left something that was neither a title nor an address.
heading::as_byline reads "Lossky, Vladimir, 1903-1958", "Vico,
Giambattista (Author)", "Kohut, Heinz.,Ornstein, Paul H." and "Patrick
Laude, Barry McDonald" as the names they are and prints them given
names first, joined with "&". Dates are years only; a role between two
names separates them; a fuller form is dropped only after an initial;
suffixes (Jr., S.J., père, Md/phd) stay where they are; the same person
twice is kept once. A result that is not plainly people (a firm, a
bracket left over, a word still in capitals, a name repeated as its own
given name) is refused.
clean() names and repairs author_role_suffix and the new
author_list_commas. A field that is only "Surname, Given" is left alone,
because some catalogues keep that order on purpose; as_byline still
turns it round for a caller that wants it.
Initials run together ("RR", "JC") and regnal numbers of any length
("XIII") are no longer cased as words.
Over a 6,022-record catalogue whose author field is a byline: 606
fields changed, read by hand; the wrong ones found on the way are now
tests.
name_in_title (weight 2): "Wilfred R Bion-Cogitations-Karnac Books
(1991)" puts the author in front of the title with a hyphen, as shadow
libraries name their downloads. The repair takes the names off the
front and the publisher, year and series off the end, and the names
are proposed as the author (method title_prefix, 0.75). Made only when
the record has no real author, or already names the same people, so a
series such as "Known Space-038-The Soft Weapon" by Larry Niven is left
alone. Compound words ("Socio-technical", "Non-Reductive") and runs of
capitals that are sentences ("Can Physicalism Be ...") are refused.
Over a 6,022-record catalogue: 28 records, each a real author in front
of a real title.
"BOOK ONE" at the top of a page means the page opens a part, and the
name under it is the part's. "A Bradford Book" and "A Scientific
American Book" are the imprint's line, set where a byline would be.
Over the front matter of 400 books: one more junk title becomes no
title, and nothing else changes.
author_is_title (weight 4): the author field is the whole title, or the
whole of the title before its subtitle when that part does not read as
a person. "Isaac Newton: Philosophical Writings" by Isaac Newton is not
caught; "Consciousness Reconsidered" by "Consciousness Reconsidered" is.
A record with this fault also gets an author proposed from its front
matter, as a missing or placeholder author already did.
Over a 6,022-record catalogue: 67 records, 37 distinct, none of them a
real author.
Every line added to the tests was read as a book's title off a real
library. Run over the front matter of 400 books, the only titles that
change are five of these, and each becomes no title at all.
textkit gains mojibake::repair, which reads UTF-8 that was decoded as
Windows-1252 back into what it was. It is certain rather than guessed:
every character has to turn back into a byte and the bytes have to be
valid UTF-8, which real Latin-1 text almost never is.
bibclean names two new faults, mojibake_title/mojibake_author and
placeholder_suffix, and now repairs four it only named before:
- mojibake in the title or author;
- "Microsoft Word - " and the like on the front of a title (junk_title);
- a document extension on the end (filename_title);
- a placeholder author on the end, "Title - Unknown" (placeholder_suffix).
A wrapper is taken off only when what is left is still a title, so
"Microsoft Word - Document2" and "0195152972.pdf" stay flagged.
"Document1", "Document2" and so on now count as placeholder titles.
Run over a 6,022-record catalogue: 120 records repaired by the new rules
(67 suffixes, 28 extensions, 21 prefixes, 4 mojibake), none of them wrong.
A lookup by ISBN took the year, publisher, language and page count from
Open Library's index, which answers for the work and gathers them from
every edition: Penguin's English War and Peace came back Spanish,
Norton's, and 1845. The index now gives only the title, the authors and
the subjects, and the edition record the rest (#6).
A cover must run to its end marker, FF D9 for a JPEG and IEND for a PNG,
so a body that only starts like an image is refused (#4). A relative
redirect whose query holds another address is resolved as relative (#5).
Closes#4, #5, #6.
Open Library's index answers about the work. Its publishers, languages,
first year and median page count are every edition's at once, and the
first of each is usually another edition's: ISBN 9780140447934, the
Penguin Classics War and Peace, came back Spanish, from W.W. Norton, in
1845.
The index is now asked only for what is true of the work (title,
subtitle, authors, subjects). A record from it is never complete, so
lookup always goes on to the edition record for container, language,
year and pages, then Google Books for whatever the edition record does
not say. A field neither gives is left out rather than filled from the
work.
Closes#6.
bookmeta gives an EPUB's cover by the routes its package can name one, and
marks a cover the file left open (a MOBI's first image, an EPUB image
found by its name) as guessed. booksniff knows RTF, Microsoft Reader,
FictionBook and comic book zips. bibfetch searches the registers by title
and author for a book with no identifier; covers by ISBN keep under Open
Library's rate limit, and a refusal for it is Error::Limited, not an
outage. The Python package gains fetch_cover, search_title and
catena.Limited.
Breaking: corpus_core::Kind has five new kinds; bibfetch::Error has
Limited; bookmeta::Cover has guessed; bibfetch::Covers has pace.
Open Library's title search, given an author as well, finds nothing for
The Ladder of Divine Ascent and four editions of Ladder of Divine Ascent.
When the title as given finds nothing, the title without a leading The, A
or An is asked, then the title and author as one free-text query, each
only when the one before found nothing. Google Books, whose anonymous
quota runs out, is asked only after all three.
A candidate whose edition gave an ISBN but no date or publisher took the
work's first_publish_year and first publisher, so one record could carry
one edition's ISBN and cover beside another's year and imprint. The id,
year, publisher, language and cover now come from the named edition only,
and are left out when it lacks them; the work gives only the title,
authors and subjects. A work with no edition named is named by its key,
not by an ISBN out of its editions' mixed list. The index is no longer
asked for the work-level fields, and gives no edition a length, so Open
Library candidates carry no pages.
When Open Library had nothing and Google Books failed, search answered
with no candidates and the CLI said no register had the title. The
failure is now the answer: Error::Limited for Google's 403, or 429 on
every attempt, which exits 75, and Error::Unreachable otherwise, exit 69.
The last route took any image whose id or address contained "cover", so
images/discover-ch1.png listed before images/cover.jpg won, and
recovery-map.png alone became the cover. A name now says cover only with
it as a word of its own: words break at anything not a letter or digit
and where a lower case letter meets a capital, so CoverImage and
Book_COVER still do. An image named cover outright comes first, then
manifest order. It is still a guess.
The guide's cover page took its first image, which can be a logo. Where
the page has several, the one whose file name, alt, id or class says
cover is taken; where none does, the first is, with a note saying how
many there were.
Each member was read no further than MAX_COVER, but nothing bounded how
many: two hundred cover-named images of 16 MiB took seven seconds to
inflate and left two hundred notes. One search now reads at most eight
members and stops with one note.
A percent-escape takes two hex digits and nothing else. from_str_radix
also takes a sign, so a%+fb decoded to a, 0x0f, b.
A zip whose members are all images was called cbz from their names alone,
so a folder of holiday photographs came back as a comic. It is now cbz
only when it carries a ComicInfo.xml or is itself named .cbz or .cbr;
otherwise it is unknown, with a note that it is a zip of N images and
would be a comic book if its name said .cbz. Only the archive's directory
is read, so members are still judged by name, and the README says so,
for a wrapped FictionBook too.
{\rtf has to be the whole control word: the byte after it must be the
version digit, a space or the next control word, so {\rtfoo is not RTF.
A FictionBook saved as UTF-16 was unknown. A byte-order mark in either
order now has the front decoded, at most 2048 code units, before the same
walk to the root element.
bookmeta: Cover::guessed says the file left the choice open — a Kindle
book's first image record, or an EPUB image picked because its name says
cover — so a caller with a register to ask can prefer that. A cover the
file names is never a guess. Cover::extension matches bibfetch's.
bibfetch: Open Library answers 403 to more than a hundred covers by ISBN
in five minutes from one address. That is now Error::Limited, not
Unreachable: the other form of the ISBN is not asked, the cover id still
is, since those are not limited, and the CLI exits 75. Covers asked by
ISBN are kept three seconds apart across the process (Covers::pace), which
stays under the limit however long a run goes. A deadline too long to add
to the clock no longer panics; it is no deadline.
bindings: fetch_cover and search_title for Python, and catena.Limited,
which fetch_identifier raises too when a register refuses for being asked
too often.
corpus-core: exit 75, a service refused for now.
A book that arrives as a file often has no identifier to ask about, only
a title and perhaps a name. `bibfetch search --title T [--author A]
[--limit N]` asks Open Library's index which books it has under those,
and Google Books only when Open Library has nothing, and prints one
record per candidate in the order the register gave them. From Rust,
`bibfetch::search(&agent, title, author, limit, attempts)`.
Each candidate is one edition. The index answers with works and, asked
for `editions.*`, names the edition of each that best matches; the ISBN,
publisher, language, year and cover come from that edition, the title,
authors, subjects and length from the work. The work's own ISBN list
mixes editions: the first War and Peace work lists four, while the
edition matched is a 1917 printing with none.
`id` is the first ISBN whose check digit agrees, in thirteen digits,
thirteen-digit entries taken first. A candidate with none is named by
the register's key: `olid` (OL…M for the edition, OL…W for the work when
no edition was named) or `googlebooks` (a volume id). Google's `OTHER`
shelfmarks are never read as ISBNs.
`cover_id` keeps the meaning it has in a lookup record: the edition's
own first cover, taken from `editions.cover_i` and only when the record
names that edition. The work's `cover_i` and `cover_edition_key` are not
asked for. A work with no edition named, and every Google Books
candidate, has none.
Open Library having nothing stands when Google Books is down; both down
is exit 69. Exit 0 a candidate, 1 none, 65 an empty title.
The retrying GET that lookups use is now `ask::get`, shared by both, and
no longer sleeps after its last attempt.