| Crates.io | crossandra |
| lib.rs | crossandra |
| version | 0.0.2 |
| created_at | 2024-12-12 17:21:49.813199+00 |
| updated_at | 2024-12-19 15:31:34.347482+00 |
| description | A straightforward tokenization library for seamless text processing. |
| homepage | |
| repository | https://github.com/trag1c/crossandra-rs |
| max_upload_size | |
| id | 1481441 |
| size | 1,228,058 |
crossandra-rs is a work-in-progress ⚠️, straightforward tokenization library for seamless text
processing. A simplified Rust implementation of the Python Crossandra library.
Add this to your Cargo.toml:
[dependencies]
crossandra = "0.0.1"
Import and use like this:
use crossandra::{Tokenizer, common};
fn main() {
let word_finder = Tokenizer::default()
.with_patterns(vec![common::WORD.clone()])
.expect("built-in pattern should be safe");
let text = "Hello, world!";
for token in word_finder.tokenize(text).flatten() {
println!("{:?}", token);
}
// Token { name: "word", value: "Hello", position: 0}
// Token { name: "word", value: "world", position: 7}
}
The documentation is available at docs.rs/crossandra.
Huge thanks to @Maneren for his invaluable guidance in developing this library 🫶
crossandra-rs is licensed under the MIT License.
© trag1c, 2024