Commit Graph
23 Commits
Author SHA1 Message Date
funkpower 1c7005460a bibclean: an ISBN-13's label is not part of the number
isbn::from_text read "ISBN-13 978-0-521-65706-8" as 1397805216: the label's
13 and the first eight digits. It now skips a -10/-13 label and returns the
first announced number whose check digit agrees.

isbn::fault names a stored ISBN that cannot be right, and problems() reports
it: invalid_isbn, placeholder_isbn (000-0-000-00000-0) and isbn_with_label
(ten digits beginning 13978 or 13979).
2026-11-24 11:24:35 -05:00
funkpower 12c42dc4dc bibclean: set a title's punctuation as a title page sets it
title_punctuation (weight 1): a space before a colon ("Sex Wars :
Sexual Dissent", a catalogue's habit), runs of spaces, a dangling
separator or full stop at the end (kept after an initial or an
abbreviation), and an article filed behind the title ("Jesuits, The")
put back in front. 128 titles in a 6,022-record catalogue.
2026-11-24 09:13:30 -05:00
funkpower f0cc4a854a bibclean: decode HTML character references in the title and author
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.
2026-11-24 08:56:42 -05:00
funkpower a5f6872175 Merge pull request 'vocabmerge: keep the best-written author heading, not the commonest' (#19) from vocabmerge-author-form into main 2026-11-24 08:55:59 -05:00
funkpower f46f4fbc95 vocabmerge: keep the best-written author heading, not the commonest
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.
2026-11-24 08:50:11 -05:00
funkpower a8f0800192 seriesof and bibclean: numbers and release tags written around a title
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.
2026-11-24 08:47:06 -05:00
funkpower 14133c9be5 bibclean: name a web address saved as a title, and leave it alone
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.
2026-11-24 08:25:47 -05:00
funkpower 894a64add2 bibclean: put a catalogue heading in the author field as a byline
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.
2026-11-24 08:21:06 -05:00
funkpower 12e9fdfd31 bibclean: take the author's name off the front of a filename title
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.
2026-11-24 08:13:22 -05:00
funkpower 4a2a4b6170 bibclean: name a login in the author field; read more copyright notices
account_author (weight 3): one word in a shape no published name has,
such as all lowercase, an underscore, digits, or capitals run on after
lowercase ("mymarasigan", "HP_Administrator", "SaravanakumarCS"). It
also asks for an author from the front matter.

The copyright reader now takes "© 2004 by …" without the word
"Copyright", passes over a notice for a translation, introduction,
notes or the like, refuses more firms (publishing houses, "Media",
"Editions", "Center", well-known imprints), and drops a particle left
dangling when the run stops at a firm's name ("Walter de").

Over 400 books' front matter, against the catalogue's own author:
proposals right 91 -> 96, wrong 23 -> 17.
2026-11-24 07:53:57 -05:00
funkpower b01c31483e bibclean: name a title copied into the author field
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.
2026-11-24 07:33:14 -05:00
funkpower 15b92d7457 bibclean: repair mojibake, word-processor prefixes, extensions and "- Unknown"
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.
2026-11-24 07:23:24 -05:00
funkpower 05b712d084 0.2.2 — a subtitle begins with a capital
title_case counted small words from the start of the whole string, so
every subtitle that opened with one was set in lower case: 'Aesthetic in
Kant: a Critique', 'Born Fighting: the Scots-Irish'. A colon starts a
title of its own and the first word of one is capitalised however small
it is.

Found by book-pipeline, which had been proposing a title page's capitals
verbatim into a catalogue and needed this to stop.
2026-09-21 11:30:26 -04:00
funkpower d47881ef3b idnorm and bibfetch: an identifier read, and a register asked 2026-09-19 19:19:54 -04:00
funkpower 4d14544409 bibclean: an abstract that arrived as an index 2026-09-19 19:09:27 -04:00
funkpower 484017fc18 vocabmerge: a subject scheme, supplied rather than compiled in 2026-09-19 19:06:57 -04:00
funkpower 9fd654ad5f docs: the manual-page flag, and the records that belong to one tool 2026-09-19 17:06:17 -04:00
funkpower 9bf59f6ebb vocabmerge: the near-duplicate headings a catalogue accumulates 2026-09-19 14:37:22 -04:00
funkpower 739e6c82e9 lints 2026-09-19 14:30:22 -04:00
funkpower 3c16892ebf bibclean: a name from the book's own pages, where the record has none 2026-09-19 14:29:12 -04:00
funkpower 14e1fcf3ef bibclean: slugs, and whether the one a record has still names it 2026-09-19 14:23:36 -04:00
funkpower 7fa610c578 each crate carries its own readme, and the contract describes rather than instructs 2026-09-19 14:15:01 -04:00
funkpower 6e26d5cf4b bibclean: record faults, weighed, with the repairs that need no lookup 2026-09-19 12:50:53 -04:00