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.
This commit is contained in:
funkpower committed 2026-11-24 07:33:14 -05:00
1 parent c2990904a0
commit b01c31483e
3 files changed
+100 -4

No files matched your search

+8 -3
View File
@@ -237,11 +237,16 @@ pub fn clean(book: &Book) -> Cleaned {
_ => None,
};
// Only for a record that has no author to overwrite. A name recovered
// from the text is evidence, not an improvement on one somebody entered.
// Only for a record that has no real author to overwrite: none, a
// placeholder, or the title copied into the field. A name recovered from
// the text is evidence, not an improvement on one somebody entered.
let author_proposal = reasons
.iter()
.any(|reason| reason == "unknown_author" || reason == "placeholder_author")
.any(|reason| {
reason == "unknown_author"
|| reason == "placeholder_author"
|| reason == "author_is_title"
})
.then(|| {
author::best(
book.title.as_deref().unwrap_or(""),