bibclean: record faults, weighed, with the repairs that need no lookup

This commit is contained in:
funkpower
2026-09-19 12:50:53 -04:00
parent c6575b2d42
commit 6e26d5cf4b
16 changed files with 1585 additions and 1 deletions
+14 -1
View File
@@ -19,7 +19,7 @@ type Written = Result<Vec<String>, String>;
type Job = (&'static str, fn() -> Written);
fn main() -> ExitCode {
let jobs: [Job; 10] = [
let jobs: [Job; 11] = [
("tokens", tokens),
("unescape", unescape),
("chunkmd", chunkmd),
@@ -30,6 +30,7 @@ fn main() -> ExitCode {
("rrf", rrf),
("cuepack", cuepack),
("booksniff", booksniff),
("bibclean", bibclean),
];
for (name, job) in jobs {
@@ -73,6 +74,18 @@ fn unescape() -> Written {
Ok(vec![path.display().to_string()])
}
fn bibclean() -> Written {
let dir = parity::golden("bibclean");
std::fs::create_dir_all(&dir).map_err(|e| e.to_string())?;
let cases = parity::dir().join("cases/bibclean/records.ndjson");
let cases = std::fs::read_to_string(&cases).map_err(|e| e.to_string())?;
let judgements = parity::run_oracle("bibclean.py", &cases)?;
let path = dir.join("records.ndjson");
std::fs::write(&path, judgements).map_err(|e| e.to_string())?;
Ok(vec![path.display().to_string()])
}
fn booksniff() -> Written {
let dir = parity::golden("booksniff");
std::fs::create_dir_all(&dir).map_err(|e| e.to_string())?;