Crates.io | spellabet |
lib.rs | spellabet |
version | 0.2.0 |
source | src |
created_at | 2023-06-08 21:57:13.604038 |
updated_at | 2023-07-25 15:48:00.152074 |
description | Convert characters into spelling alphabet code words |
homepage | https://github.com/EarthmanMuons/spellout/tree/main/crates/spellabet |
repository | https://github.com/EarthmanMuons/spellout/tree/main/crates/spellabet |
max_upload_size | |
id | 885792 |
size | 36,786 |
Convert characters into spelling alphabet code words.
A Rust library for transforming text strings into corresponding code words based on predefined spelling alphabets, like the NATO phonetic alphabet. These alphabets are designed to enhance verbal clarity, especially when spelling out words over low-fidelity voice channels. This library supports several standard alphabets and allows for customization to suit specific communication needs.
In operation, spellabet preserves the original capitalization of letters by returning either lowercase or uppercase code words. It similarly converts known digits and other symbols into code words, while unrecognized characters are returned unconverted.
This library powers the command line utility spellout
, which provides a handy
interface for phonetic conversions. Check out spellout on GitHub for more
information.
To use the crate, add it as dependency in your Cargo.toml
file:
[dependencies]
spellabet = "0.2.0"
use spellabet::{PhoneticConverter, SpellingAlphabet};
let converter = PhoneticConverter::new(&SpellingAlphabet::Nato);
println!("{}", converter.convert("Example123!"));
ECHO x-ray alfa mike papa lima echo One Two Tree Exclamation
For detailed examples of using this library, along with the latest generated API reference documentation, please visit https://earthmanmuons.github.io/spellout/spellabet/index.html.
spellabet was inspired by the output from the no-longer-in-existence WinGuides Secure Password Generator that disappeared back in January 2007, and the similarly inspired Lingua::Alphabet::Phonetic::Password Perl module written by James FitzGibbon.
spellabet is distributed under the terms of both the Apache License (Version 2.0) and the MIT License.
See LICENSE-APACHE and LICENSE-MIT for details.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
If you would like to contribute to the project, please read our guide for contributors.