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
- ArabicReshaper
- Flags to enable some or all groups of ligatures
- The main Config struct for the ArabicReshaper
Enums
- Supported languages
Functions
- Reshape the given text with the default ArabicReshaper configuration.
Keep in mind that if you want to reshape a large amount of lines its better to first create a ArabicReshaper and use theArabicReshaper::reshapeinstead.