colophon: role words, page counts and title lines are not people

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").
This commit is contained in:
funkpower committed 2026-11-24 08:59:45 -05:00
1 parent 3360de29ae
commit 6f876e8052
2 files changed
+212 -13

No files matched your search

+39
View File
@@ -312,14 +312,53 @@ fn is_furniture(line: &str) -> bool {
false
}
/// The people a byline names, each held to the shape of a person's name:
/// a title page sets a series name or a line of the title in the same
/// capitals as its author ("MARESFIELD LIBRARY", "A BASIC THEORY OF").
fn people(who: &str) -> Vec<String> {
who.split(&[';', '&'][..])
.flat_map(|part| part.split(" and "))
.map(|name| name.trim().trim_end_matches(['.', ',']).trim().to_string())
.filter(|name| name.len() >= 3 && name.split_whitespace().count() <= 5)
.filter_map(|name| bibclean::author::clean(&name))
.filter(|name| crate::cip::reads_as_a_name(name))
.filter(|name| name.split_whitespace().count() >= 2 || is_known_mononym(name))
.collect()
}
/// A single name is a person only where it is one of the handful that go by
/// one: anything else alone on a byline line is a word of the title.
fn is_known_mononym(name: &str) -> bool {
const MONONYMS: &[&str] = &[
"Aeschylus",
"Aristotle",
"Augustine",
"Cicero",
"Dante",
"Epictetus",
"Euripides",
"Herodotus",
"Hesiod",
"Homer",
"Josephus",
"Livy",
"Lucretius",
"Ovid",
"Plato",
"Plotinus",
"Plutarch",
"Proclus",
"Seneca",
"Sophocles",
"Tacitus",
"Thucydides",
"Virgil",
"Voltaire",
"Xenophon",
];
MONONYMS.contains(&name)
}
/// Words a line ends on when the typesetter broke a title across it.
///
/// `Esotericism in` / `Western Culture` is one title set on two lines, and