Skip to main content

observations/
observations.rs

1fn main() {
2    let docs: Vec<String> = [
3        "Acme Corp supplies the Defence Ministry with airframes in 2026.",
4        "Acme Corp supplies the Defence Ministry with sensors in 2026.",
5        "Acme Corp is not permitted to supply the Defence Ministry in 2026.",
6        "A field survey recorded Acme Corp near Violet City at 240 m.",
7        "A field survey recorded Beta Corp near Violet City at 310 m.",
8        "A field survey recorded Gamma Corp near Violet City at 180 m.",
9        "Beta Corp supplies the Defence Ministry with airframes in 2026.",
10        "Gamma Corp is not permitted to supply the Defence Ministry in 2026.",
11    ].iter().map(|s| s.to_string()).collect();
12    let db = steeldb::SteelDb::ingest(docs).unwrap();
13    println!("categories: {:?}", db.askable());
14    println!("\nrelation tags actually produced:");
15    for t in db.tags().get("rel").map(|v| v.as_slice()).unwrap_or(&[]).iter()
16        .filter(|t| t.contains("supplies") || t.contains("permitted/-")) { println!("{t}"); }
17    println!("\nbelief intervals:");
18    for t in ["state/asserted","state/negated"] {
19        let i = db.belief(t);
20        println!("{t:16} [{:.2}, {:.2}]   ignorance {:.2}", i.belief, i.plausibility, i.ignorance());
21    }
22    println!("\nverbatim refusal:");
23    match db.query("gene/brca1") { Ok(_)=>{}, Err(r)=>println!("{r}") }
24}