citefind: a note that remarks first and cites second

The bar a guessed title has to clear was waived when the entry also gave up
a container, on the reasoning that a container vouches for the rest of the
reading. Auditing the corpus rather than the reference chapters showed that
is wrong, and wrong on the commonest note there is:

    As Lewis White Beck has rightly put it. See his Early German
    Philosophy (Cambridge, Mass., 1969), p. 439.

The remark opens, the citation follows, and the second sentence becomes the
container — so the first was stored as the work and the book named in it was
lost. Neither a siglum nor a remark is the name of a work now, whatever else
came off the entry.

Measured where these notes actually live, which is flagged body chunks
rather than bibliography chapters: on the corpus the class ran at 1.43% of
rows naming a work. The cost is 46 rows in 34,359 on the reference holdout,
where the share naming an author rises from 88.1% to 88.2%.
This commit is contained in:
funkpower
2026-09-20 18:11:12 -04:00
parent c09fc41721
commit b53ef4329c
2 changed files with 32 additions and 8 deletions
+23 -4
View File
@@ -624,10 +624,14 @@ pub fn one(text: &str, marker: Option<&str>) -> Option<Reference> {
// than no answer, because it is stored and looks settled.
if guessed && out.authors.is_empty() && out.ids.is_empty() {
let refused = out.title.as_deref().is_some_and(|title| {
// A siglum is not the name of a work whatever else the entry
// gave up; a remark is only recognisable as one when nothing
// else was read, because a container vouches for the rest.
SIGLUM.is_match(title) || (out.container.is_none() && PREDICATE.is_match(title))
// Neither a siglum nor a remark is the name of a work, whatever
// else came off the entry. A container does not vouch for the
// title here: the commonest note of all remarks first and cites
// second — `As Lewis White Beck has rightly put it. See his
// Early German Philosophy (Cambridge, Mass., 1969), p. 439.` —
// and reading that as a work with a container stored the remark
// and lost the book.
SIGLUM.is_match(title) || PREDICATE.is_match(title)
});
if refused {
out.title = None;
@@ -2235,6 +2239,21 @@ mod tests {
}
}
#[test]
fn a_note_that_remarks_first_and_cites_second_keeps_neither_as_a_title() {
// The remark opened the note and the citation followed it, so the
// second sentence became a container and vouched for the first.
// Nothing in this names a work the record can carry.
let read = one(
"As Lewis White Beck has rightly put it. See his Early German \
Philosophy (Cambridge, Mass., 1969), p. 439.",
None,
)
.expect("a record");
assert_eq!(read.title, None);
assert_eq!(read.pages.as_deref(), Some("439"));
}
#[test]
fn a_title_the_entry_marked_up_is_taken_at_its_word() {
// The other side of the same bar, and why it is drawn at the guess