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
//! # AMT — Articulatory Moment Transform
//!
//! Language-agnostic phonetic name matching via spectral fingerprinting of
//! universal sonority class sequences.
//!
//! ## Quick start
//!
//! ```
//! use amt::{encode_token, matches, similarity};
//!
//! // Encode a single name
//! let code = encode_token("Khaled");
//!
//! // Test match across transliterations and scripts
//! assert!(matches("Khaled", "Khalid"));
//! assert!(matches("Khaled", "خالد"));
//! assert!(matches("Gamal", "Jamal"));
//! assert!(!matches("Khaled", "Robert"));
//!
//! // Graded similarity in [0, 1]
//! let s = similarity("Khaled Sameer", "khaled samir");
//! assert!(s > 0.9);
//! ```
//!
//! ## Indexed fuzzy search
//!
//! ```
//! use amt::{encode_token, BKTree};
//!
//! let mut tree: BKTree<String> = BKTree::new();
//! for name in ["Khaled", "Khalid", "Ahmed", "Robert"] {
//! let code = encode_token(name);
//! for &sp in &code.spectrals {
//! tree.add(sp, name.to_string());
//! }
//! }
//!
//! let query = encode_token("Khaleed");
//! let hits = tree.query(query.spectrals[0], 4);
//! ```
//!
//! ## Algorithm
//!
//! Each name is mapped to a sequence of 8 sonority classes, projected onto
//! the first 4 Chebyshev polynomials, Gray-quantized, and packed into a
//! 32-bit spectral key. A parallel 64-bit Bloom signature over skip-bigrams
//! of the same sequence captures edit-tolerant co-occurrence patterns.
//! Two names match if they share any spectral key.
//!
//! See the whitepaper in the repository for full details, benchmarks against
//! Soundex / Metaphone / Double Metaphone / NYSIIS / Beider-Morse, and
//! theoretical justifications.
// Enable `#[doc(cfg(...))]` annotations on docs.rs only (requires nightly).
// Flattened re-exports — the common path. `self::` disambiguates from `::core`.
pub use ;
pub use BKTree;
pub use ;
pub use ;