summaryrefslogtreecommitdiff
path: root/lib/citation/book.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/citation/book.ml')
-rw-r--r--lib/citation/book.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/citation/book.ml b/lib/citation/book.ml
index 545e324..2a2b9c0 100644
--- a/lib/citation/book.ml
+++ b/lib/citation/book.ml
@@ -78,6 +78,11 @@ let all = List.map fst table @ tradition_targets
let tokens =
List.concat_map (fun (id, sp) -> List.map (fun s -> (s, id)) sp) table
+let default_spelling id =
+ match List.assoc_opt id table with
+ | Some (first :: _) -> first
+ | Some [] | None -> id
+
let of_token s =
let s = String.trim s in
List.assoc_opt s tokens