pub struct ReshaperConfig {
    pub language: Language,
    pub delete_harakat: bool,
    pub shift_harakat_position: bool,
    pub delete_tatweel: bool,
    pub support_zwj: bool,
    pub use_unshaped_instead_of_isolated: bool,
    pub support_ligatures: bool,
    /* private fields */
}
Expand description

The main Config struct for the ArabicReshaper

You can change all kinds of settings about ArabicReshaper using this struct.

Fields§

§language: Language

Supported languages are: Arabic, ArabicV2, Kurdish More languages might be supported soon.

§delete_harakat: bool

Whether to delete the Harakat (Tashkeel) before reshaping or not.

§shift_harakat_position: bool

Whether to shift the Harakat (Tashkeel) one position so they appear correctly when string is reversed

§delete_tatweel: bool

Whether to delete the Tatweel (U+0640) before reshaping or not.

§support_zwj: bool

Whether to support ZWJ (U+200D) or not.

§use_unshaped_instead_of_isolated: bool

Use unshaped form instead of isolated form.

§support_ligatures: bool

Whether to use ligatures or not. Serves as a shortcut to disable all ligatures.

Implementations§

source§

impl ReshaperConfig

source

pub fn new(language: Language, ligatures_flags: LigaturesFlags) -> Self

Create a new ReshaperConfig with the given LigaturesFlags.

source

pub fn update_ligature(&mut self, key: LigatureNames, enable: bool)

Update the given LigatureNames.

Trait Implementations§

source§

impl Clone for ReshaperConfig

source§

fn clone(&self) -> ReshaperConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for ReshaperConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.