Skip to main content

Mishkal: Arabic text diacritization library for Python

Project description

Mishkal Arabic text vocalization software مشكال لتشكيل النصوص العربية

Developpers: Taha Zerrouki: taha dot zerrouki at gmail dot com

Feature s




1.10 Bouira





Mailing list

` <>`__




Downloa d


Feedbac ks


Account s

[@Facebook]( [@Twitter]( [@Sourceforge](


author = {Taha Zerrouki},
title = {Towards An Open Platform For Arabic Language Processing},
type = {PhD thesis},
institution = {Ecole Nationale Supérieure d'informatique, Alger, Algérie},
date = {2020},


You can Install Mishkal as library or Software ### Python lib

pip install mishkal

Install from github

  1. Clone mishkal project from GitHub:

git clone
  1. Install necessary packages:

pip install -r miskal/requirements.txt


- pyarabic  : basic arabic library
- sylajone  : aranasyn syntaxical analyzer
- arramooz  : arabic morphological dictionary
- asmai     : semantic analyzer
- CodernityDB :  pure python, fast, NoSQL database, used as cache system to minimize load of morphological analyzer
- collocations : collocation library ( deprecated)
- libqutrub : verb conjugation library used by morphological analyzer
- maskouk   : collocation library
- naftawayh : word tag library
- qalsadi   ; morphological analyzer
- tashaphyne : light stemmer used by morphological analyzer


Mishkal provides:

  • Console command line

  • python library

  • GUi interface

  • Web interface

  • API interface ### GUI:

  • Windows: MishkalGui.exe

  • GUI: Linux python interfaces/gui/ ### Web server (linux, windows) python3 interfaces/web/mishkal-webserver

  • serving on view at

  • open in your browser the URL:

Console (linux/windows)

$ python3 bin/ -f filename

Usage: bin/  -f filename [OPTIONS]
           bin/  'السلام عليكم' [OPTIONS]

        [-f | --file = filename]       input file
        [-o | --outfile = filename]    output file to write vocalized text to, '$FILENAME (Tashkeel).txt' by default

        [-h | --help]             outputs this usage message
        [-v | --version]        program version
        [-p | --progress]      display progress status
        [-a | --verbose]       enable verbosity

        * Tashkeel Actions
        [-r | --reduced]        Reduced Tashkeel.
        [-s | --strip]             Strip tashkeel (remove harakat).
        [-c | --compare]      compare the vocalized text with the program output

        * Tashkeel Options
        [-l | --limit]             vocalize only a limited number of line
        [-x | --syntax]         disable syntaxic analysis
        [-m | --semantic]    disable semantic analysis
        [-g | --train]             enable training option
        [-i | --ignore]           ignore the last Mark on output words.
        [-t | --stat]               disable statistic tashkeel

This program is licensed under the GPL License


pip install mishkal


>>> import mishkal.tashkeel
>>> vocalizer = mishkal.tashkeel.TashkeelClass()
>>> text = u"تطلع الشمس صباحا"
>>> vocalizer.tashkeel(text)
' تَطْلُعُ الشَّمْسُ صَبَاحًا'

JSON connection API التشكيل عن بعد

يمكن استدعاء خدمة الموقع عبر مكتبة جيسون json و ajax من أي موقع، ويمكنك استعمالها في موقعك. * طريقة الاستدعاء 1- باستعمال تقنية json مع مكتبة Jquery

<!DOCTYPE html   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <script src=""></script>
  <div id="result">

$().ready(function() {
$.getJSON("", {text:"السلام عليكم\nاهلا بكم\nكيف حالكم", action:"TashkeelText"},
  function(data) {


الاستدعاء يكون كما يأتي

$.getJSON("", {text:"السلام عليكم\nاهلا بكم\nكيف حالكم", action:"TashkeelText"},


  • text: النص المطلوب تشكيله.

  • action: العملية المطلوبة وهنا هي TashkeelText.

النتيجة تكون من الشكل

{"result": " السّلامُ عَلَيكُمْ اهلا بِكُمْ كَيْفَ حالُكُمْ", "order": "0"}


  • result: النص الناتج المشكول.

  • order: رقم السطر في النص الأصلي، فإذا كان النص الأصلي كبيرا يقسمه المشكال لعدد من الاسطر، وقد لا يرجعون في نفس الترتيب، لذا حددنا رقم الترتيب.

How does Mishkal work:

Mishkal use a rule based method to detect relations and diacritics, First, it analyzes all morphological cases, it generates all possible diacritized word forms, by detecting all affixes and check it in a dictionary. second, It add word frequency to each word.

The two previous steps are made by support/Qalsadi ( arabic morphological analyzer), the used dictionary is a separated project named ‘Arramooz: arabic dictionnary for morphology”.

Third, we use a syntax analyzer to detect all possible relations between words. The syntax library is named support/ArAnaSyn. This analyzer is basic for the moment, it use only linear relations between adjacent words.

Forth, all data generated and relations will be analyzed semantically, to detect semantic relation in order to reduce ambiguity. The use libary is support/asmai ( Arabic semantic analysis). The semantic relations extraction is based on corpus. The used corpus is named “Tashkeela: arabic vocalized texts corpus”.

In the final stage, The module mishkal/tashkeel tries to select the suitable word in the context, it tries to get evidents cases, or more related cases, else, it tries to select more probable case, using some rules like select a stop word by default, or select Mansoub case by default.

The rest of program provides functions to handles interfaces and API with web/desktop or command line

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

mishkal-0.4.1-py3-none-any.whl (789.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page