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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! Type-level programming patterns for compile-time safety.
//!
//! Witness types and extension traits that encode
//! invariants in the type system. Once data is parsed into these types,
//! downstream code can rely on the invariant without re-checking.
//!
//! # Bounded Value Types
//!
//! | Type | Precision | Domain | When to Use |
//! |------|-----------|--------|-------------|
//! | [`Confidence`] | f64 | [0, 1] | All confidence/probability scores |
//!
//! `Confidence` is re-exported from `crate::core`. It supports construction
//! from raw values (`new`), logits (`from_logit`), and scaled logits
//! (`from_logit_scaled`).
//!
//! # Extension Traits
//!
//! | Trait | Extends | Purpose |
//! |-------|---------|---------|
//! | [`EntitySliceExt`] | `[Entity]` | Filter, sort, group entity collections |
//!
//! # Example
//!
//! ```rust
//! use anno::types::EntitySliceExt;
//! use anno::{Confidence, Entity, EntityType};
//!
//! let conf = Confidence::new(0.95); // Clamps to [0, 1]
//! let from_logit = Confidence::from_logit(2.5); // Applies sigmoid
//!
//! let entities = vec![
//! Entity::new("John", EntityType::Person, 0, 4, conf.value()),
//! ];
//! let high_conf: Vec<_> = entities.above_confidence(0.8).collect();
//! ```
pub use crateConfidence;
pub use EntitySliceExt;
/// Static assertions for struct layouts and invariants.