mirror of
https://git.pumpin.online/funkpower/catena.git
synced 2026-11-24 19:32:56 +00:00
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:
4 files changed
+94
-1
No files matched your search
@@ -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");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user