1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// In the name of Allah

//! # arabic_reshaper
//!
//! Reconstruct Arabic sentences to be used in applications that don't support Arabic script.
//!
//! `arabic_reshape` :
//!
//! Reshape letters
//!
//! ```rust
//! use arabic_reshaper::arabic_reshape;
//! let salam = "سلام";
//! println!("{}",arabic_reshape(salam));
//! // سلام correctly rendred.
//! ```
//!
//! **More info:**
//!
//! Check the original python version.
//!
//! [python-arabic-reshaper](https://github.com/mpcabd/python-arabic-reshaper)

mod algorithm;
mod config_parser;
mod letters;
mod ligatures;
#[cfg(test)]
mod tests;

pub use algorithm::ArabicReshaper;

pub fn arabic_reshape(text: &str) -> String {
    let mut ar = ArabicReshaper::new();

    ar.reshape(text)
}