Crate ar_reshaper

source ·
Expand description

ArabicReshaper

Reconstruct Arabic sentences to be used in applications that don’t support Arabic script.

Usage:

use ar_reshaper::{ArabicReshaper, reshape_line};
 
let reshaper = ArabicReshaper::default();
 
// You can reshape just a single string using
println!("{}", reshaper.reshape("سلام دنیا"));
// or [`reshape_line`] method if you dont want to construct the [ArabicReshaper]
// and you just want to reshape a line with default settings
println!("{}", reshape_line("سلام دنیا"));
// Both will reconstruct the string and print `ﺳﻼﻡ ﺩﻧﯿﺎ`
 
// Or a slice of strings
println!("{:#?}", reshaper.reshape_lines(&["سلام خوبی؟", "عالیم ممنون"]));
// this will reconstruct the string and print  ["ﺳﻼﻡ ﺧﻮﺑﯽ؟", "ﻋﺎﻟﯿﻢ ﻣﻤﻨﻮﻥ"]

A rusty rewrite of python-arabic-reshaper You can check the original repository for more information.

Structs

Enums

Functions