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
48
49
50
//! `characterminator` -- find and eliminate characters outside an allowed
//! set, per file type and per file, so text costs fewer tokens.
//!
//! The crate is federated: every directory under `src/` is one Rust module
//! and one spec node, and each node's `SPEC.md` states what it owns. This
//! file composes and re-exports; it holds no logic of its own (`src:V38`).
//!
//! The nodes are PRIVATE. What a library user may name is the short list
//! below, re-exported here and nowhere else (`src:V98`): enough to check a
//! string against a set, rewrite it, and read the hazards in it. Everything
//! else -- rule resolution, config assembly, rendering -- is the binary's
//! business until a release decides to promise it.
//!
//! Every function that judges a character takes the caller's rule as one
//! predicate, `impl Fn(char) -> bool` (`.:I`): a set's `contains`, or any
//! closure.
//!
//! ```
//! use characterminator::{Map, SetCatalog, fix, scan_str};
//!
//! let ascii = SetCatalog::builtin().resolve("ascii", "text")?;
//! let hits = scan_str("a\u{2014}b", |c| ascii.contains(c));
//! assert_eq!(hits.len(), 1);
//! let fixed = fix("a\u{2014}b", &Map::builtin(), |c| ascii.contains(c))?;
//! assert_eq!(fixed.output, "a--b");
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
/// The binary's entry point. Not part of the library promise: `main.rs`
/// is a shim over it (`src:V38`), and it lives here so the dispatch is
/// testable rather than reachable only by launching a process.
pub use run;