citefind: the short note a history book uses for everything after the first

`Unger, Dutch Shipbuilding, 33-4` — a surname, a short title, and where in
it. No year, no publisher, nothing but commas. It is how a humanities book
cites a work it has already given in full, which is most of what its notes
are: one book in the corpus has 2,229 such chunks and this read almost none
of them.

The locators trailing a short note are not part of its title — `Sjoerds,
Algemene Beschryvinge, i, f I, 501-2` cites the Beschryvinge, not the
Beschryvinge-comma-i-comma-f-I. An entry ending on a year is an imprint and
goes on being read as one.

Also: a work after a semicolon may open on a quotation mark, and the marks a
style puts round a short title belong to the style.

626 more references over the 202 reference sections sampled from the corpus.
This commit is contained in:
funkpower
2026-09-20 14:22:43 -04:00
parent d31206dd0f
commit 6f39b75d94
3 changed files with 136 additions and 5 deletions
+28
View File
@@ -212,6 +212,34 @@ fn the_body_of_a_page_is_not_the_first_of_the_notes_at_its_foot() {
);
}
#[test]
fn a_short_note_citing_two_works_gives_two_records() {
let found = read(
"12 Unger, Dutch Shipbuilding, 33-4; Unger, 'Dutch herring', 256-9.\n\
13 Van Gelder, The Two Reformations, 213, 312; Herwaarden, 'Geloof en geloofsuitingen', 403-4.",
);
assert_eq!(found.len(), 4, "{found:#?}");
assert_eq!(
found
.iter()
.map(|one| one.title.as_deref())
.collect::<Vec<_>>(),
[
Some("Dutch Shipbuilding"),
Some("Dutch herring"),
Some("The Two Reformations"),
Some("Geloof en geloofsuitingen"),
]
);
assert_eq!(
found
.iter()
.map(|one| one.marker.as_deref())
.collect::<Vec<_>>(),
[Some("12"), Some("12"), Some("13"), Some("13")]
);
}
#[test]
fn nothing_citation_shaped_gives_nothing() {
assert!(read("Bibliography\n\nSee below.\n\n233\n").is_empty());