rupantor/
lib.rs

1//! **Rupantor** is a very flexible Bengali phonetic parser
2//! written in Rust.
3//! 
4//! `rupantor` converts text into Bengali text by obeying the _rules_
5//! given in a _grammar_. A grammar is actually a Json formated data.
6//! 
7//! **Avro Phonetic** is a very popular phonetic based transliteration method 
8//! for writing Bengali. `rupantor` supports Avro Phonetic writing method out of the box.
9//! User can use Avro Phonetic by using the [`AvroPhonetic`](avro/struct.AvroPhonetic.html).
10//! 
11//! # Example: Using Avro Phonetic to convert text into Bengali
12//! ```rust
13//! use rupantor::avro::AvroPhonetic;
14//! 
15//! let avro = AvroPhonetic::new();
16//! let bengali = avro.convert("ami banglay gan gai");
17//! assert_eq!(bengali, "আমি বাংলায় গান গাই");
18//! ```
19//! 
20//! `rupantor` is very flexible as the conversion is driven by a __grammar__ file. Actually
21//! the [`AvroPhonetic`](avro/struct.AvroPhonetic.html) struct uses [`PhoneticParser`](parser/struct.PhoneticParser.html)
22//! struct and a Avro Phonetic [grammar file](https://github.com/OpenBangla/rupantor-rs/blob/master/src/AvroPhonetic.json)
23//! internally to do the conversion.
24//! 
25//! The phonetic conversion algorithm was actually implemented by
26//! [Rifat Nabi](https://github.com/torifat) in [JavaScript](https://github.com/torifat/jsAvroPhonetic)
27//! and [ObjectiveC](https://github.com/torifat/iAvro/blob/master/AvroParser.m).
28//! This crate is the Rust port of that phonetic conversion algorithm.
29
30pub mod parser;
31pub mod avro;