Skip to content

aborazmeh/textlint-rule-arabic-diacritics

Repository files navigation

textlint-rule-arabic-diacritics Actions Status: test textlint rule

rules for Arabic diacritics issues

Install

Install with npm:

npm install textlint-rule-arabic-diacritics

Fixable

textlint rule

textlint --rule no-kasheeda --fix README.md

Examples

Normalize textlint rule

أهلﴼ وسهلﴼ بكم

Diacritic characters will be transformed to their mappings

أهلاً وسهلاً بكم

You can also have a loot at textlint-rule-arabic-letter-forms

Loose Diacritics textlint rule

أهلا ً وسهلا ً بكم

Only diacritics will be removed and there likely to be an extra space

أهلا  وسهلا  بكم

No Duplicated Diacritics on the Same Letter textlint rule

يونََُُِِس: قال أبو عبيدة، «يقال:يونس بضم النون وكسرها». والمشهور في القراءة يونُس برفع النون من غير همز.

Duplicated diacritics will be removed

يونَُِس: قال أبو عبيدة، «يقال:يونس بضم النون وكسرها». والمشهور في القراءة يونُس برفع النون من غير همز.

No Shadda With Madda

Shadda can't be combined with Madda

الآّن والآّن والآّن

No Shadda with Sukun

Shadda can't be combined with Sukun

ضيّْق

No Middle Tanween

لا يمكن للتنوين أن يأتي في وسًٍط وسٍط وسٌط الكلمة

Only Fathatan on Alef

تجريباٌ تجريباٍ

Fathatan Before Alef textlint rule

أهلاً وسهلﴼ

Some standards write Fathatan on Alef Mamduda while others write it on the letter before you can specify that option, fixing this will normalize the character

أهلًا وسهلًا

No Multiple Diacritics on the Same Letter

This option is false by default, but you can turn it on to make sure every letter can take only one basic diacritic.

وَأَيوُّبَ وَيُوسَُِف": قُرأ يوسف بضم السين وكسرها وفتحها، وكلُّ هذه القراءات لغات، أفصحها ضمٌ السين.

This will yield error when the option is turned on.

Usage

Via .textlintrc.json(Recommended)

These are default options, you can change them in your .textlintrc file

{
    "rules": {
        "arabic-diacritics": {
          "remove_loose_diacritics": true,
          "no_shadda_with_madda": true,
          "no_shadda_with_sukun": true,
          "no_duplicated_diacritics": true,
          "only_fathatan_on_alef": true,
          "fathatan_before_alef": true,
          "no_multiple_diactritics": false
        }
    }
}

Via CLI

textlint --rule arabic-diacritics README.md

Build

Builds source codes for publish to the lib folder. You can write ES2015+ source codes in src/ folder.

npm run build

Tests

Run test code in test folder. Test textlint rule by textlint-tester.

npm test

TODO

  • No consecutive five Harakat
  • No consecutive three Sokoon
  • No Tanween and Haraka on the same letter
  • No Haraka and Sukun on the same letter
  • No Sukun on the first letter of the word
  • No Madda with Hamza

License

MIT © aborazmeh

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published