{"id":17718554,"url":"https://github.com/linuxscout/pyarabic","last_synced_at":"2025-05-15T13:07:00.218Z","repository":{"id":14203518,"uuid":"16910168","full_name":"linuxscout/pyarabic","owner":"linuxscout","description":"pyarabic","archived":false,"fork":false,"pushed_at":"2024-01-14T11:06:02.000Z","size":1294,"stargazers_count":455,"open_issues_count":14,"forks_count":87,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-05-14T04:07:20.556Z","etag":null,"topics":["arabic-language","nlp-library","text-processing"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linuxscout.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"patreon":"linuxscout"}},"created_at":"2014-02-17T10:59:29.000Z","updated_at":"2025-03-25T16:49:06.000Z","dependencies_parsed_at":"2024-01-14T12:26:51.202Z","dependency_job_id":"6a6fdc07-7eed-4fad-b744-0ac8d330ee7d","html_url":"https://github.com/linuxscout/pyarabic","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxscout%2Fpyarabic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxscout%2Fpyarabic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxscout%2Fpyarabic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxscout%2Fpyarabic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linuxscout","download_url":"https://codeload.github.com/linuxscout/pyarabic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arabic-language","nlp-library","text-processing"],"created_at":"2024-10-25T14:54:50.445Z","updated_at":"2025-05-15T13:07:00.180Z","avatar_url":"https://github.com/linuxscout.png","language":"Python","readme":"# PyArabic\n\n![build](https://github.com/linuxscout/pyarabic/actions/workflows/build_test.yml/badge.svg)\n\nA specific *Arabic language* library for **Python**, provides basic functions to manipulate Arabic letters and text, like detecting Arabic letters, Arabic letters groups and characteristics, remove diacritics etc.\n\nمكتبة برمجية للغة العربية بلغة بيثون، توفر دوالا للتحكم في الحروف والنصوص، مثلا تحديد نوع الحرف، حذف الحركات، مقارنة التشكيل.\n\n![downloads](https://img.shields.io/pypi/dm/PyArabic?style=plastic)\n\n\n  Developpers:  Taha Zerrouki: http://tahadz.com\n    taha dot zerrouki at gmail dot com\n\nFeatures |   value\n---------|---------------------------------------------------------------------------------\nAuthors  | Taha Zerrouki: http://tahadz.com,  taha dot zerrouki at gmail dot com\nRelease  | 0.6.12 \nLicense  |[GPLv3](https://github.com/linuxscout/pyarabic/blob/master/LICENSE)\nTracker  |[linuxscout/pyarabic/Issues](https://github.com/linuxscout/pyarabic/issues)\nWebsite  |[https://pypi.python.org/pypi/pyarabic](https://pypi.python.org/pypi/pyarabic)\nDoc  |[package Documentaion](https://pyarabic.readthedocs.io/)\nSource  |[Github](http://github.com/linuxscout/pyarabic)\nDownload  |[pypi.python.org](https://pypi.python.org/pypi/pyarabic)\nFeedbacks  |[Comments](https://github.com/linuxscout/pyarabic/issues)\nAccounts  |[@Twitter](https://twitter.com/linuxscout)  [@Sourceforge](http://sourceforge.net/projects/pyarabic/)\n\n\n\n## Citation\n[![DOI](https://joss.theoj.org/papers/10.21105/joss.04886/status.svg)](https://doi.org/10.21105/joss.04886)\n\n\nZerrouki, T., (2023). PyArabic: A Python package for Arabic text. \nJournal of Open Source Software, 8(84), 4886, https://doi.org/10.21105/joss.04886  \n\nT. Zerrouki‏, Pyarabic, An Arabic language library for Python,\n  https://pypi.python.org/pypi/pyarabic/, 2010\n\n```\nor in bibtex format\n\n```bibtex\n@article{Zerrouki2023,\n\ttitle        = {PyArabic: A Python package for Arabic text},\n\tauthor       = {Taha Zerrouki},\n\tyear         = 2023,\n\tjournal      = {Journal of Open Source Software},\n\tpublisher    = {The Open Journal},\n\tvolume       = 8,\n\tnumber       = 84,\n\tpages        = 4886,\n\tdoi          = {10.21105/joss.04886},\n\turl          = {https://doi.org/10.21105/joss.04886}\n}\n```\nor \n```bibtex\n@misc{zerrouki2012pyarabic,\n  title={pyarabic, An Arabic language library for Python},\n  author={Zerrouki, Taha},\n  url={https://pypi.python.org/pypi/pyarabic,\n  year={2010}\n}\n```\n\n\n\n\n\n## مزايا\n* تصنيف الحروف\n* تفريق النص إلى وحدات (جمل أو كلمات)\n* حذف الحركات:( كل الحركات، الحركات عدا الشدة، حذف الشدة، حذف التطويل، حذف الحركة الأخيرة)\n* فصل الحركات عن النصوص وإدماجها\n* اختزال التشكيل\n* قياس التماثل بين كلمتين ( في الحركات جزئيا وكليا، التماثل مع وزن)\n* تنميط الحروف ( توحيد التراكيب مثل لام الألف، والهمزات)\n* تحويل الأعداد إلى كلمات\n* استخلاص العبارات العددية من النص\n* تشكيل أولي للعبارات العددية\n* قلب النصوص العربية للأنظمة التي لا تدعم تشبيك الحروف\n\n## Features\n* Arabic letters classification\n* Text tokenization into words or sentences\n* Strip Harakat ( all, except Shadda, tatweel, last_haraka)\n* Sperate and  join Letters and Harakat\n* Reduce tashkeel\n* Mesure tashkeel similarity ( Harakats, fully or partially vocalized, similarity with a template)\n* Letters normalization ( Ligatures and Hamza)\n* Numbers to words\n* Extract numerical phrases\n* Pre-vocalization of numerical phrases\n* Unshiping texts\n\n\n### Applications\n\n* Arabic text processing\n\n### Installation\n```\npip install pyarabic\n```\n\n### Usage\n```python\nimport pyarabic.araby as araby\nimport pyarabic.number as number\n```\n\n\n\n\n### Package Documentation\n[https://pyarabic.readthedocs.io/](https://pyarabic.readthedocs.io/)\n\n#### Files\n* file/directory    category    description \n * araby.py: arabic routins.\n * named.py: handle named enteties recognation.\n * unshape.py: unshaping arabic text\n\n## وصف\nمكتبة بيثون للعربيةPyArabic  مكتبة برمجية تجمع في طياتها خصائص ووظائف يحتاجها المبرمج للتعامل مع النصوص العربية، وهي مستوحاة من مكتبة بي أتش بي العربية لصديقنا خالد الشمعة، التي تستهدف توفير مصدر مفتوح لكثير من وظائف النصوص العربية لاستعمالها في مجال النشر في الإنترنت.\n\n### تعريف نص عربي\nأفضل طريقة للتعامل مع النصوص العربية بلغة بيثون هو استخدام الترميز يونيكود، التي يدعمها بيثون دعما أصليا، لا حاجة فيه إلى مكتبات خارجية أو دوال خاصة، وقد يكون هذا أهمّ ما دفعني لاختيار لغة بيثون، إذ يكفي أن تسبق النص بحرف يو u  لتدع بيثون يريحك من عناء التفكير وبرمجة النصوص، ويعامل معها بشفافية عالية.\n\nتعريف نص عربي بترميز يونيكود\n\n```python\ntext = u'الإسلام ديننا'\n```\n\nاختيار ترميز ملف المتن.\n```\n﻿#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n```\n\nعرض النص العربي في المخرج\n```\nprint text.encode('utf8')\n```\n\nاسم المكتبة pyarabic\nفيها العديد من الوظائف المجمعة في وحدات:\n\nفيها العديد من الوظائف المجمعة في وحدات:\n* وحدة : araby.py  وفيها الثوابت كالحروف وأسمائها ومجموعاتها والوظائف العامة كحذف الحركات وحذف التطويل ومقارنة التشكيل بين الكلمات، وضبط  علامات الترقيم.\n* وحدة الأعداد number.py : وفيها وظائف تحويل الأعداد إلى كلمات والكلمات إلى أعداد، كشف ألفاظ الأعداد في النص، وتشكيلها.\n* وحدة المسميات : named.py وفيها وظائف لكشف الأسماء والمسميات في النص.\n\n\n### وحدة الوظائف العامة araby\nيمكن استدعاؤها بالأمر \n```python\nImport pyarabic.araby as araby\n```\n\nوسنستعمل الاختصار araby  فيما بعد\nالثوابت العامة في مكتبة عربي:\nتضم الحروف العربية  ومجموعاتها المختلفة وبعض الأنماط المستخدمة لاحقا في وظائف مختلفة\n1- الحروف العربية الأساسية مع تسميات لاتينية لاستعمالها في البرمجة\n\nThe arabic chars contains all arabic letters, a sub class of unicode,\n\n```python\nCOMMA            = u'\\u060C'\nSEMICOLON        = u'\\u061B'\nQUESTION         = u'\\u061F'\nHAMZA            = u'\\u0621'\nALEF_MADDA       = u'\\u0622'\nALEF_HAMZA_ABOVE = u'\\u0623'\n```\nالمزيد في ملف araby.py\n\nتضم مجموعة الحروف العربية الحروف الأساسية، والحركات والأرقام، وعلامات الترقيم، وبعض الحروف الخاصة كالألف الخنجرية والياء الصغيرة، و لامات الألف بأشكالها.\n#### مجموعات الأحرف: \nويمكن تقسيم الحروف في مجموعات وتصنيفات نستعملها فيما بعد في الوظائف المختلفة\n\nالاسم العربي | وصف المجموعة | عناصرها\n--------|--------------|------------\nالحروف | مجموعة الحروف العربية دون حركات | LETTERS = u'ابتةثجحخدذرزسشصضطظعغفقكلمنهويءآأؤإئ' \nالتشكيل  | مجموعة الحركات مع الشدة مدرجة  | TASHKEEL =(FATHATAN, DAMMATAN, KASRATAN, FATHA,DAMMA,KASRA, SUKUN,   SHADDA)\nالحركات | مجموعة الحركات دون الشدة مدرجة | HARAKAT =(  FATHATAN,   DAMMATAN,   KASRATAN,  FATHA,  DAMMA,  KASRA, SUKUN);\nالحركات القصيرة | الحركات القصيرة دون تنوين | SHORTHARAKAT =( FATHA,  DAMMA,  KASRA, SUKUN);\nالتنوين | حركات التنوين | TANWIN =(FATHATAN,  DAMMATAN,   KASRATAN);\nالمركبات | لامات الألف في أشكالها المختلفة | LIGUATURES = (u'ﻻ', u'ﻷ', u'ﻹ', u'ﻵ') \nالهمزات | الهمزة في أشكالها المختلفة | HAMZAT = (u'ء', u'ؤ', u'ئ', u'ٔ', u'ٕ', u'إ', u'أ') \nالألفات | الألف في أشكالها المختلفة | ALEFAT = (u'ا', u'آ', u'أ', u'إ', u'ٱ', u'ى', u'ٰ') \nحروف العلة | الياء والواو والألف | WEAK = (u'ا', u'و', u'ي', u'ى') \nالياءات | ما يرسم مثل الياء، الصغيرة منها، والألف المقصورة والهمزة على النبرة | YEHLIKE = (u'ي', u'ئ', u'ى', u'ۦ') \nالواوات | ما يرسم مثل الواو | WAWLIKE = (u'و', u'ؤ', u'ۥ') \nالتاءات | التاء المربوطة والمفتوحة | TEHLIKE = (u'ت', u'ة') \nالحروف الصغيرة | الألف والياء والواو الصغار | SMALL = (u'ٰ', u'ۥ', u'ۦ') \nالحروف القمرية | الحروف القمرية | MOON = (u'ء', u'آ', u'أ', u'إ', u'ا', u'ب', u'ج', u'ح', u'خ', ... \nالحروف الشمسية | الحروف الشمسية | SUN = (u'ت', u'ث', u'د', u'ذ', u'ر', u'ز', u'س', u'ش', u'ص', u... \nترتيب الحروف العربية | يعطي لكل حرف عربي رقما ترتيبيا فالألف واحد والباء اثنان والهمزة 29. | AlphabeticOrder = {u'ء': 29, u'آ': 29, u'أ': 29, u'ؤ': 29, u'إ... \nأسماء الحروف | يعطي كل حرف اسمه العربي | NAMES = {u'ء': u'همزة', u'آ': u'ألف ممدودة', u'أ': u'همزة على ... \n\n\n#### الوظائف- الدوال\n\n##### أهم الوظائف\n\nوصف الدالة  |الدالة\n------|------------\nحذف الحركات كلها بما فيها الشدة|strip_tashkeel(text)\nحذف الحركات كلها ماعدا الشدة|strip_harakat(text)\nحذف الحركة الأخيرة|strip_lastharaka(text)\nحذف التطويل| strip_tatweel(text)\nتنميط أشكال الهمزة المختلفة | normalize_hamza(text)\nتفريق كلمات النص |tokenize(text)\nتفريق جمل النص |sentence_tokenize(text)\n\nطالع الوظائف والأمثلة في [ملف المزايا](https://github.com/linuxscout/pyarabic/blob/master/doc/features.md)\n\n[features.md](https://github.com/linuxscout/pyarabic/blob/master/doc/features.md)\n","funding_links":["https://patreon.com/linuxscout"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxscout%2Fpyarabic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxscout%2Fpyarabic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxscout%2Fpyarabic/lists"}