1. Getting started

arabic-utils is an NPM package designed for use in both browser and Node environments. It offers a range of convenient utilities specifically tailored for Arabic string manipulation, including functionalities like token search, removing diacritics and more.

Installation command: npm install arabic-utils

Check out the package Github repository for more informations.

2. Demos

2.1 normalize

Normalize the Arabic text based on the specified options or the default options.

Options:
Before:
Example text
هَـٰذَا النص يحاكي أنماط كتابة مختلفة وفيه كلمات مٌشَكَّلَة وغير مشكّلة، وكلمات قصيرة وطويـــــــــــــــــــــــــلة وهو نص قابل للتعديل ( إستخدم الزر في الأسفل ).
After:
Normalized text
هذا النص يحاكي انماط كتابة مختلفة وفيه كلمات مشكلة وغير مشكلة، وكلمات قصيرة وطويلة وهو نص قابل للتعديل ( استخدم الزر في الاسفل ).

2.2 getMatches

Retrieves the matched parts from the given Arabic text based on the search token.

Search token:
Options:
Example text
Matches found: 1
هَـٰذَا النص يحاكي أنماط كتابة مختلفة وفيه كلمات مٌشَكَّلَة وغير مشكّلة، وكلمات قصيرة وطويـــــــــــــــــــــــــلة وهو نص قابل للتعديل ( إستخدم الزر في الأسفل ).