โStrip Functions
set of utility functions for stripping various characters from Arabic text.
Table of Contents
stripHarakat
Syntax
stripHarakat(text)
Description
Removes harakat (vowel marks) from the given text if it is vocalized except Shadda.
Parameters
text
(string): The input Arabic text.
Returns
(string): The modified text with harakat except Shadda removed.
Example
const text = "ุงูุณููููุงู
ู ุนูููููููู
ู";
const strippedHarakat = stripHarakat(text);
console.log(strippedHarakat); // "ุงูุณููุงู
ุนูููู
"
stripLastHaraka
Syntax
stripLastHaraka(text)
Description
Removes the last haraka (vowel mark) from the given text if it is vocalized.
Parameters
text
(string) The input Arabic text.
Returns
string
The modified text with the last haraka removed.
Example
const text = "ุงูุณููููุงู
ู ุนูููููููู
ู";
const strippedLastHaraka = stripLastHaraka(text);
console.log(strippedLastHaraka); // "ุงูุณููููุงู
ู ุนูููููููู
"
stripTashkeel
Syntax
stripTashkeel(text)
Description
Removes tashkeel (diacritic marks) from the given text if it is vocalized.
Parameters
text
(string) The input Arabic text.
Returns
string
The modified text with tashkeel removed.
Example
const text = "ุงูุณููููุงู
ู ุนูููููููู
ู";
const strippedTashkeel = stripTashkeel(text);
console.log(strippedHarakat); // "ุงูุณูุงู
ุนูููู
"
stripSmall
Syntax
stripSmall(text)
Description
Removes all Small Alef (ุงูุฎูุฌุฑูุฉ),Small WAW ,Small Yeh Arabic from the given text.
Parameters
text
(string) The input Arabic text.
Returns
string
The modified text with small Arabic Small Alef (ุงูุฎูุฌุฑูุฉ),Small WAW ,Small Yeh removed.
Example
const text = "ุงูุณููููุงู
ู ุนูููููููู
ู";
const strippedSmall = stripSmall(text);
console.log(strippedSmall); // "ุงูุณููููุงู
ู ุนูููููููู
ู"
stripTatweel
Syntax
stripTatweel(text)
Description
Removes tatweel (elongation character) from the given text.
Parameters
text
(string) The input Arabic text.
Returns
string
The modified text with tatweel removed.
Example
const text = "ุงูุณูููููุงู
ู ุนููููููููู
ู";
const strippedTatweel = stripTatweel(text);
console.log(strippedTatweel); // "ุงูุณููููุงู
ู ุนูููููููู
ู"
stripShadda
Syntax
stripShadda(text)
Description
Removes shadda (stress mark) from the given text.
Parameters
text
(string): The input Arabic text.
Returns
string
The modified text with shadda removed.
Example
const text = "ุงูุณููููุงู
ู ุนูููููููู
ู";
const strippedShadda = stripShadda(text);
console.log(strippedShadda); // "ุงูุณูููุงู
ู ุนูููููููู
ู"
Last updated