mirror of
https://git.pumpin.online/funkpower/catena.git
synced 2026-11-24 19:32:56 +00:00
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.
This commit is contained in:
4 files changed
+78
No files matched your search
@@ -160,6 +160,7 @@ const WEIGHTS: &[(&str, u32)] = &[
|
||||
("author_role_suffix", 2),
|
||||
("edited_volume", 1),
|
||||
("filename_title", 3),
|
||||
("html_entity", 2),
|
||||
("junk_title", 3),
|
||||
("lowercase_title", 2),
|
||||
("missing_apostrophe", 2),
|
||||
@@ -230,6 +231,10 @@ pub fn problems(title: Option<&str>, author: Option<&str>, isbn: Option<&str>) -
|
||||
{
|
||||
reasons.push("numeric_author");
|
||||
}
|
||||
if crate::fix::decode_entities(title).is_some() || crate::fix::decode_entities(author).is_some()
|
||||
{
|
||||
reasons.push("html_entity");
|
||||
}
|
||||
if textkit::mojibake::is_mojibake(title) {
|
||||
reasons.push("mojibake_title");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user