arabic-diacritics-remover
v1.0.1
Published
Normalize Arabic Text The normalize-arabic-text library is a simple utility that provides a function to normalize Arabic text. This normalization process involves removing diacritics and non-Arabic characters, as well as converting various Arabic charact
Downloads
107
Readme
Normalize Arabic Text The normalize-arabic-text library is a simple utility that provides a function to normalize Arabic text. This normalization process involves removing diacritics and non-Arabic characters, as well as converting various Arabic characters to their standardized forms. Additionally, Arabic numerals are converted to their English counterparts.
Installation You can install the library using npm: npm install normalize-arabic-text
Usage Once you've installed the library, you can use it in your JavaScript projects as follows: const normalizeArabic = require('normalize-arabic-text');
const inputText = "٦ سُوْرَةُ الدَّهْرِ مَدَنِيَّةٌ هَلْ أَتَى عَلَى الْإِنْسَانِ حِينٌ مِنَ الدَّهْرِ لَمْ يَكُنْ"; const normalizedText = normalizeArabic(inputText); console.log(normalizedText);
Removes diacritics and non-Arabic characters. Converts variations of certain Arabic characters to their standardized forms (e.g., آ, إ, أ to ا; ة to ه; ئ, ؤ to ء; ى to ي). Converts Arabic numerals (٠١٢٣٤٥٦٧٨٩) to their English counterparts (0123456789).
Parameters input (string): The Arabic text you want to normalize. Return Value The function returns a normalized version of the input Arabic text.