1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Cutter call number generation for library cataloging.
//!
//! `csan-core` derives shelf-ready cutter numbers from author names (or, for
//! anonymous works, titles) using two methods:
//!
//! * **Cutter-Sanborn three-figure** — a lookup against the bundled
//! Cutter-Sanborn table, with optional call number prefix and lowercase
//! work mark ([`CutterSanbornMethod`]).
//! * **Library of Congress** — the `LoC` character-branching rules,
//! producing an initial plus a digit sequence ([`CutterLocMethod`]).
//!
//! Input names are normalized first: whitespace and punctuation are
//! stripped, diacritics are folded to ASCII, `Mc`/`M'` prefixes expand to
//! `Mac`, and `St`/`Ste` expand to `Saint`/`Sainte`, matching the
//! conventions of the underlying tables.
//!
//! # Example
//! ```
//! use csan_core::{
//! Attribution, Author, CutterConfig, CutterGenerator, CutterLocMethod,
//! CutterSanbornMethod, Opus,
//! };
//!
//! let entry = Attribution::Both {
//! author: Author::new("Charles", "Dickens"),
//! opus: Opus::new("Oliver Twist"),
//! };
//!
//! let sanborn = CutterSanbornMethod::generate(&entry, CutterConfig::default())?;
//! assert_eq!(sanborn.to_string(), "D548o");
//!
//! let loc = CutterLocMethod::generate(&entry, CutterConfig::default())?;
//! assert_eq!(loc.to_string(), "D535");
//! # Ok::<(), csan_core::NormalizationError>(())
//! ```
pub use ;