haqor_core/lib.rs
1//! App-facing Bible access and Hebrew learning core.
2
3/// Version of this crate, so an app can report which core it is running
4/// without hard-coding a number that drifts from `Cargo.toml`. Shown in the
5/// app's About view alongside the data build from [`bible::Bible::data_version`].
6pub const VERSION: &str = env!("CARGO_PKG_VERSION");
7
8/// Biblical Hebrew verb/noun paradigm generator (algorithmic, not DB-backed).
9pub use haqor_morphology as morphology;
10
11/// Utilities for interacting with Bible resources.
12pub mod bible;
13
14/// Grammar concepts and learner-facing teaching content.
15pub mod grammar;
16
17/// Hand-maintained lexicon and learner-gloss overlays.
18pub mod lexicon_overlay;
19
20/// Pronominal-ending inventory and stem/suffix splitting.
21pub mod pronoun_suffix;
22
23/// Safe snapshot and merge support for synchronising learner progress.
24pub mod progress_sync;
25
26/// Learner-facing romanization of pointed Hebrew.
27pub mod romanize;
28
29/// Build-time resolution of a surface to word info, searching the generation
30/// databases. `gen-runtime` precomputes its output into `haqor.db`.
31pub mod resolve;
32
33mod surface;
34pub use surface::normalize_surface;
35
36/// Lossless SEDRA-to-Hebrew and Hebrew-to-Syriac conversion.
37pub mod transliterate;
38
39/// Spaced-repetition reading tutor.
40pub mod tutor;
41
42/// Curated learner glosses for high-frequency surfaces.
43pub mod vocab_gloss;
44
45/// Narrow bridge used by the generated-data crate.
46#[doc(hidden)]
47pub mod data_support {
48 use rusqlite::Connection;
49
50 pub fn decode_pgn(pgn: &str) -> (Option<String>, Option<String>, Option<String>) {
51 crate::bible::decode_pgn(pgn)
52 }
53
54 pub fn decode_noun_label(label: &str) -> (Option<String>, Option<String>) {
55 crate::bible::decode_noun_label(label)
56 }
57
58 pub fn lexicon_fallback(db: &Connection, surface: &str) -> Option<(String, String, String)> {
59 crate::bible::lexicon_fallback(db, surface)
60 }
61
62 /// A word's bare consonants, finals folded — the key the pointing-blind rung
63 /// of the lexicon bridge matches on, and what `surface.cons` stores so the
64 /// runtime can match a name against its entry without a SQL function.
65 pub fn fold_consonants(word: &str) -> String {
66 crate::bible::fold_consonants(word)
67 }
68
69 /// The connection the generation databases are attached to, so the
70 /// curation stage can copy between schemas in SQL instead of ferrying
71 /// every row through Rust.
72 pub fn connection(bible: &crate::bible::Bible) -> &Connection {
73 bible.conn()
74 }
75}