Pure Rust Port of the SWORD Bible Software Library
# Add to your Cargo.toml [dependencies] rsword_chirho = "0.1"
use rsword_chirho::{SwMgrChirho, VerseKeyChirho}; fn main_chirho() -> Result<(), Box<dyn std::error::Error>> { // Load modules from system paths (~/.sword, /usr/share/sword, etc.) let mgr_chirho = SwMgrChirho::with_system_paths_chirho()?; // List available modules for name_chirho in mgr_chirho.get_module_names_chirho() { println!("Found module: {}", name_chirho); } // Get a Bible module and look up a verse if let Some(mut module_chirho) = mgr_chirho.get_module_driver_chirho("KJV")? { let key_chirho = VerseKeyChirho::from_str_chirho("John 3:16")?; module_chirho.set_key_chirho(&key_chirho)?; let text_chirho = module_chirho.get_raw_entry_chirho()?; println!("{}: {}", key_chirho, text_chirho); } Ok(()) }
Complete compatibility with SWORD module binary formats: RawText, RawText4, zText, RawCom, zCom, RawLD, zLD, RawGenBook.
Built-in support for zlib, bzip2, and xz/lzma compression formats used by modern SWORD modules.
KJV, Catholic, LXX, Vulgate, Luther, Synodal, NRSV, Leningrad, and Ethiopian verse numbering systems.
Tantivy-powered search with Boolean operators, wildcards, fuzzy matching, and phrase search.
Convert OSIS, ThML, and GBF markup to HTML or plain text. Extract Strong's numbers, morphology, footnotes.
Install modules from CrossWire and other SWORD repositories. List, update, and remove modules.
Drop-in replacements for diatheke, installmgr, osis2mod, and other SWORD command-line utilities.
No C++ dependencies. Cross-compiles to any target Rust supports. WebAssembly ready.
| Type | Driver | Description |
|---|---|---|
| Biblical Texts | RawTextChirho, ZTextChirho |
Bible translations with verse-keyed access |
| Commentaries | RawComChirho, ZComChirho |
Verse-keyed commentary content |
| Lexicons | RawLdChirho, ZLdChirho |
Dictionaries, Strong's concordances |
| General Books | RawGenBookChirho |
Tree-structured content |
| Daily Devotional | DailyDevotionalChirho |
Date-keyed devotional readings |
rsword_chirho/
├── keys_chirho/ # Key types (VerseKey, TreeKey, StrKey, DateKey)
├── versification_chirho/ # Verse systems (KJV, Catholic, LXX, etc.)
├── modules_chirho/ # Module drivers (RawText, zText, RawLD, etc.)
├── storage_chirho/ # Binary format handlers (RawVerse, ZVerse)
├── compression_chirho/ # Compression (zlib, bzip2, xz)
├── filters_chirho/ # Markup filters (OSIS, ThML, GBF → HTML/plain)
├── search_chirho/ # Search engines (Tantivy, Regex)
├── manager_chirho/ # Module & Install managers
├── transport_chirho/ # FTP/HTTP for module downloads
├── import_chirho/ # OSIS/TEI/IMP parsers
└── locale_chirho/ # Internationalization
// .conf file → ModuleConfigChirho → ModuleFactory → SwModule // ↓ // storage_chirho (RawVerse/ZVerse/RawStr) // ↓ // SwModuleChirho trait (read/iterate/search)