bindings: the footnote signal, which book-pipeline still had its own copy of

`looks_like_footnote_citations` is the function chunkmd's `looks_like_citations`
was ported from, and book-pipeline was still running the Python original at
four call sites. Bound on all four surfaces so it can stop.

Checked against the Python over 34,458 chunks of the live corpus: no
disagreement.
This commit is contained in:
funkpower
2026-09-20 14:44:09 -04:00
parent e896cf4f4f
commit 6aeea58147
8 changed files with 56 additions and 0 deletions
+7
View File
@@ -220,6 +220,12 @@ fn identify<'py>(py: Python<'py>, name: &str, data: &[u8]) -> PyResult<Bound<'py
to_py(py, &crate::identify(name, data))
}
/// Whether a chunk of body text carries footnote or endnote citations.
#[pyfunction]
fn looks_like_footnote_citations(text: &str) -> bool {
crate::looks_like_footnote_citations(text)
}
/// Read the references out of a bibliography or a page of notes.
#[pyfunction]
fn find_citations<'py>(py: Python<'py>, text: &str) -> PyResult<Bound<'py, PyList>> {
@@ -290,6 +296,7 @@ fn _catena(module: &Bound<'_, PyModule>) -> PyResult<()> {
module.add_function(wrap_pyfunction!(fuse_hits, module)?)?;
module.add_function(wrap_pyfunction!(identify, module)?)?;
module.add_function(wrap_pyfunction!(find_citations, module)?)?;
module.add_function(wrap_pyfunction!(looks_like_footnote_citations, module)?)?;
module.add_function(wrap_pyfunction!(citation_prompt, module)?)?;
module.add_function(wrap_pyfunction!(merge_citation_reply, module)?)?;
module.add_function(wrap_pyfunction!(series_of, module)?)?;