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.
This commit is contained in:
funkpower committed 2026-11-24 09:13:30 -05:00
1 parent d203dedb64
commit 12c42dc4dc
4 files changed
+94 -1

No files matched your search

+4
View File
@@ -178,6 +178,7 @@ const WEIGHTS: &[(&str, u32)] = &[
("release_tags", 1),
("sentence_case_title", 1),
("title_in_author", 3),
("title_punctuation", 1),
("underscore_title", 1),
("unknown_author", 3),
("url_title", 4),
@@ -210,6 +211,9 @@ pub fn problems(title: Option<&str>, author: Option<&str>, isbn: Option<&str>) -
if URL_TITLE.is_match(title) {
reasons.push("url_title");
}
if crate::fix::tidy_punctuation(title).is_some() {
reasons.push("title_punctuation");
}
if crate::fix::strip_leading_number(title).is_some() {
reasons.push("numbered_title");
}