Bind Gutenberg editions by title when Open Library lists no work; answer work pages by searching #1

Merged
Manielle merged 5 commits from feat/matched-work-binding into main 2026-10-19 20:59:13 +00:00
Showing only changes of commit 560effe226 - Show all commits
@@ -769,7 +769,7 @@ fn etext_of(body: &Value, gutenberg_id: u64) -> Etext {
pub fn main_title(raw: &str) -> String { pub fn main_title(raw: &str) -> String {
let lower = raw.to_lowercase(); let lower = raw.to_lowercase();
let head = lower let head = lower
.split(|c: char| matches!(c, ';' | ':' | '(' | '[')) .split([';', ':', '(', '['])
.next() .next()
.unwrap_or_default(); .unwrap_or_default();
let head = head.find(", or").map_or(head, |i| &head[..i]); let head = head.find(", or").map_or(head, |i| &head[..i]);