{ "info": { "author": "Abdelkrime Aries", "author_email": "kariminfo0@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Natural Language :: Arabic", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Topic :: Education", "Topic :: Software Development :: Build Tools", "Topic :: Text Processing :: Linguistic" ], "description": "# Aruudy\n\n[![Project](https://img.shields.io/badge/Project-Aruudy-0BDA51.svg?style=plastic)](https://kariminf.github.io/aruudy/)\n[![License](https://img.shields.io/badge/License-Apache_2-0BDA51.svg?style=plastic)](http://www.apache.org/licenses/LICENSE-2.0)\n[![PyPI](https://img.shields.io/pypi/v/aruudy.svg?style=plastic)](https://pypi.python.org/pypi/aruudy)\n[![Downloads](https://img.shields.io/pypi/dm/aruudy.svg?style=plastic)](https://pypi.org/project/aruudy/)\n[![Python version](https://img.shields.io/pypi/pyversions/aruudy.svg?style=plastic)](https://pypi.org/project/aruudy/)\n[![Travis](https://img.shields.io/travis/kariminf/aruudy.svg?style=plastic)](https://travis-ci.org/kariminf/aruudy)\n[![Codecov](https://img.shields.io/codecov/c/github/kariminf/aruudy.svg?style=plastic)](https://codecov.io/gh/kariminf/aruudy)\n[![CodeFactor](https://www.codefactor.io/repository/github/kariminf/aruudy/badge/master)](https://www.codefactor.io/repository/github/kariminf/aruudy/overview/master)\n[![codebeat badge](https://codebeat.co/badges/9ea7f2f7-58cb-4df9-b4b7-33d33aee07aa)](https://codebeat.co/projects/github-com-kariminf-aruudy-master)\n[![Code Climate](https://img.shields.io/codeclimate/maintainability-percentage/kariminf/aruudy.svg?style=plastic)](https://codeclimate.com/github/kariminf/aruudy/)\n\nAruudy is a light library for Arabic prosody (Aruud) or \"Science of Poetry\".\n\n[Test here](https://kariminf.github.io/aruudy/)\n\n[web API: kariminf.pythonanywhere.com/](https://kariminf.pythonanywhere.com/)\n\n## Notions\n\n- **Verse [Bayt]**: (\u0628\u064a\u062a) a line of poetry which is composed of two parts.\n- **Hemistich [Shatr]**: (\u0634\u0637\u0631) a part of a verse\n- **Meter [Bahr]**: (\u0628\u062d\u0631) The rhythme\n- **Scansion [Wazn]**: (\u0648\u0632\u0646) the weight of syllables, or the rhythmic structure\n- **Foot [Tafiila]**: (\u062a\u0641\u0639\u064a\u0644\u0629) the rhythmic parts which compose the scansion\n\nIn Arabic scansion, we use two letters:\n- \"w\": watad [peg] (\u0648\u062a\u062f); it represents a vowelled letter\n- \"s\": sabad [cord] (\u0633\u0628\u0628); it represents an unvowelled letter\n\nIn english scansion, we use two characters:\n- \"u\": short syllable;\n- \"-\": long syllable\n\n## Features\n\n- bahr\n - Recover all meters (arabic name, english name, transliterated name)\n - Get the meters information by either its arabic or english names\n\n\n- poetry\n - Information about Arabic poetery meters\n - Normalizing part (shatr) of a verse: delete tatweel, add forgotten diacretics\n - Writing the part into prosody form\n - Finding the arabic prosodic units \"watad\" and \"sabab\" based on haraka (vowel)\n - Finding the english prosodic units based on syllables\n - Detecting Arabic poetry meter\n - Affording feet types and the parts according to these feet\n\n\n- web\n - API with flask\n - CGI (Common Gateway Interface) program\n\n\n## Use\n\n### Install\n\n```\npip install aruudy\n```\n\n### Command line\n\n#### List all available meters\n\n```sh\naruudy [-l | --list] [a|e|t]\n```\nWill print the 16 meters names in\n- Arabic if the option is \"a\"\n- English if the option is \"e\"\n- Transliteration if the option is \"t\"\n\nFor example:\n\n```sh\naruudy -l a\n```\n\n![shell ls](img/shell.ls.ar.png)\n\n#### Get information about a meter\n\n```sh\naruudy [-i, --info] \n```\n\nThe name can be in Arabic or in English.\n\nExample:\n\n```sh\naruudy -i long\n```\n\n![shell ls](img/shell.info.en.png)\n\n#### Get the meter of a Shatr (part of verse)\n\n```sh\naruudy [-s, --shatr] \n```\n\nExample:\n\n```sh\naruudy -s \"\u0623\u064e\u0633\u0650\u0631\u0652\u0628\u064e \u0627\u0644\u0642\u064e\u0637\u0627 \u0647\u064e\u0644\u0652 \u0645\u064e\u0646\u0652 \u064a\u064f\u0639\u0650\u064a\u0652\u0631\u064f \u062c\u064e\u0646\u0627\u062d\u064e\u0647\u064f\"\n```\n\n![shell shatr](img/shell.shatr.found.png)\n\n### Web Api\n\nThe api uses **flask** which must be installed. To test the api on your machine (locally), type:\n\n```sh\naruudy_flask\n```\n\nThis will create a server on **http://127.0.0.1:5000**.\n\nThe api has these request types:\n\n#### $host/ls\n\nReturns a json list with names of available Arabic poetry meters (16 meters).\nThe names are:\n- arabic: Arabic names of the 16 meters\n- english: English equivalent names\n- trans: transliterated names\n\n![api ls](img/api.ls.png)\n\n#### $host/info/[name]\n\nRetrieve information about a meter by its name (arabic or english).\nIt returns a json object describing the meter (bahr).\n\n- name: an object containing the different names of the meter\n - arabic: Arabic names of the 16 meters\n - english: English equivalent names\n - trans: transliterated names\n\n\n- std_scansion and used_scansion: the standard scansion of the bahr, and the used one.\nThe two of them have the following elements:\n - ameter: meter used by Arabs as defined by Al-Khalil\n - emeter: the meter by syllables (European method)\n - mnemonic: the feet of the hemistich\n - type: the type of each foot\n\n\n- key: a verse which describs the bahr\n\n```\n$host/info/long\n```\n\n![api info ar](img/api.info.ar.png)\n\n```\n$host/info/complete\n```\n\n![api info en](img/api.info.en.png)\n\n#### $host/shatr/[text]\n\nUsed to find the meter of the given text (a shatr: part of the verse). It returns a json object with these information:\n- norm: the text normalized: no tatweel, fix some diacretics\n- prosody: prosody writing (\u0627\u0644\u0643\u062a\u0627\u0628\u0629 \u0627\u0644\u0639\u0631\u0648\u0636\u064a\u0629) of the text\n- ameter: the arabic meter of the text\n- emeter: the english/european meter of the text\n- bahr: the name of the bahr\n - if not found, it is a string \"None\"\n - if found, it is a json object with all the bahr's description\n\n- parts: the text divided into parts accoding to the feet (as a list). each element is an object with the following information:\n - emeter: foot's english meter\n - mnemonic: foot's mnemonic\n - part: part of the text that fits the foot\n - type: the type of the foot\n\n```\n$host/shatr/\u0641\u064e\u0640\u0644\u0627%20\u062a\u064e\u0638\u064f\u0640\u0646\u0651\u0640\u0646\u0651%20\u0623\u0646\u0651%20\u0627\u0644\u0644\u0651\u064a\u0652\u0640\u062b\u064e%20\u064a\u064e\u0628\u0652\u062a\u064e\u0633\u0650\u0640\u0645\u064f\n```\n\n![api shatr found](img/api.shatr.found.png)\n\n```\n$host/shatr/\u0641\u064e\u0640\u0644\u0627%20\u062a\u064e\u0638\u064f\u0640\u0646\u0651\u0640\u0646\u0651%20\u0623\u0646\u0651\n```\n\n![api shatr none](img/api.shatr.none.png)\n\n#### $host/shatr/[text]/[opt]\n\nSame as **$host/shatr/[text]**, but you can choose which elements to include in the response by separating their names with a comma (\",\"). If you ommit \"bahr\", it will return just the names of the meter and not all its information. Example:\n\n```\n$host/shatr/\u0641\u064e\u0640\u0644\u0627%20\u062a\u064e\u0638\u064f\u0640\u0646\u0651\u0640\u0646\u0651%20\u0623\u0646\u0651%20\u0627\u0644\u0644\u0651\u064a\u0652\u0640\u062b\u064e%20\u064a\u064e\u0628\u0652\u062a\u064e\u0633\u0650\u0640\u0645\u064f/ameter\n```\n![api shatr incl](img/api.shatr.incl.png)\n\nThis will return the names of the meter with the texts arabic scansion.\n\nIf you want to include all elements and ommit some, you can put a minus in front of your options list. Example:\n\n```\n$host/shatr/\u0641\u064e\u0640\u0644\u0627%20\u062a\u064e\u0638\u064f\u0640\u0646\u0651\u0640\u0646\u0651%20\u0623\u0646\u0651%20\u0627\u0644\u0644\u0651\u064a\u0652\u0640\u062b\u064e%20\u064a\u064e\u0628\u0652\u062a\u064e\u0633\u0650\u0640\u0645\u064f/-parts,bahr\n```\n![api shatr excl](img/api.shatr.excl.png)\n\nIf you put \"none\", you will receive just the names of the meter.\n\n```\n$host/shatr/\u0641\u064e\u0640\u0644\u0627%20\u062a\u064e\u0638\u064f\u0640\u0646\u0651\u0640\u0646\u0651%20\u0623\u0646\u0651%20\u0627\u0644\u0644\u0651\u064a\u0652\u0640\u062b\u064e%20\u064a\u064e\u0628\u0652\u062a\u064e\u0633\u0650\u0640\u0645\u064f/none\n```\n![api shatr nopt](img/api.shatr.nopt.png)\n\n### Programming\n\nArabic poetry meter detection\n\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom aruudy.poetry import prosody\n\ntext = u'\u0623\u064e\u0633\u0650\u0631\u0652\u0628\u064e \u0627\u0644\u0642\u064e\u0637\u0627 \u0647\u064e\u0644\u0652 \u0645\u064e\u0646\u0652 \u064a\u064f\u0639\u0650\u064a\u0652\u0631\u064f \u062c\u064e\u0646\u0627\u062d\u064e\u0647\u064f'\n\nshatr = meter.process_shatr(text)\n\n#Normalized text\nprint(\"normalized: \" + shatr.norm)\n\n#prosody form\nprint(\"prosody form: \" + shatr.prosody)\n\n# Farahidi meter for poetry\nprint(\"arabic scansion: \" + shatr.ameter)\n\n# Western-like metre\nprint(\"western scansion: \" + shatr.emeter)\n\n#get the bahr: it has aname, ename, trans,\nb = shatr.bahr\n\n```\n\nYou can process a text with sub-functions (without using **meter.process_shatr** which uses them all):\n- **meter.normalize(text)**: returns a normalized text; deletes tatweel and fix some diacretics problems\n- **meter.prosody_form(text)**: returns the prosody writing (\u0627\u0644\u0643\u062a\u0627\u0628\u0629 \u0627\u0644\u0639\u0631\u0648\u0636\u064a\u0629) of the text\n- **meter.get_ameter(text)**: returns a string of arabic meter with \"v\" as haraka \"c\" as sukuun\n\n**TODO**: edit a full doc about the api\n\n## Recommendations\n\nTo detect the meter, the poem's part must be fully vocalized (has diacritics).\nTo this end, It is recommended to use [Mishkal](https://github.com/linuxscout/mishkal)\n\n\n## License\nCopyright (C) 2014-2019 Abdelkrime Aries\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kariminf/aruudy", "keywords": "arabic nlp languages poetry prosody", "license": "Apache-2.0", "maintainer": "", "maintainer_email": "", "name": "aruudy", "package_url": "https://pypi.org/project/aruudy/", "platform": "", "project_url": "https://pypi.org/project/aruudy/", "project_urls": { "Homepage": "https://github.com/kariminf/aruudy" }, "release_url": "https://pypi.org/project/aruudy/0.4.1/", "requires_dist": null, "requires_python": "", "summary": "Arabic poetry package", "version": "0.4.1" }, "last_serial": 4713521, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "e45e40fb0dcfe30d0ca83e89ec0f786d", "sha256": "b219a5a7ecca6b1b2a8b8edafb3320645b57c94a8899fbf62ddace9b54147da1" }, "downloads": -1, "filename": "aruudy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e45e40fb0dcfe30d0ca83e89ec0f786d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2306, "upload_time": "2017-07-27T14:25:43", "url": "https://files.pythonhosted.org/packages/6b/a3/a440efeeade06564fdaad47a6653422a561b6c1a0eacf8c483637ab62377/aruudy-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "5d2ac75c4e92253ed3d00ca3580f831a", "sha256": "7f70e9530b958eeaeaa34de26e101eb1bb0b239c8c4d89fb8c4b50b47bb6f581" }, "downloads": -1, "filename": "aruudy-0.1.2.tar.gz", "has_sig": false, "md5_digest": "5d2ac75c4e92253ed3d00ca3580f831a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7315, "upload_time": "2017-07-27T14:44:58", "url": "https://files.pythonhosted.org/packages/ef/71/f5b5cefb8eacd4248a5244c3071cea0c4dcb63981d0955ab02cfe8bc61e8/aruudy-0.1.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "a4bb457f7024060de0a5793366654837", "sha256": "b2d54f8eb31c248a293c77581ffd2613740e5b25ec50fa03405e104df29ee056" }, "downloads": -1, "filename": "aruudy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "a4bb457f7024060de0a5793366654837", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12482, "upload_time": "2019-01-02T18:10:49", "url": "https://files.pythonhosted.org/packages/26/89/e39c6ff42ef6c2aad50fb019eae964939820068615ba5c6fbb03b7dab237/aruudy-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "859f292230a17b387f9ddb73f653b796", "sha256": "049f5fc661fb7900299aecb27c176d485976cb92975b713c519de2f4fdbc54c4" }, "downloads": -1, "filename": "aruudy-0.3.0.tar.gz", "has_sig": false, "md5_digest": "859f292230a17b387f9ddb73f653b796", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13957, "upload_time": "2019-01-11T21:36:23", "url": "https://files.pythonhosted.org/packages/47/5c/5c55b5412220350b6865f5733ca23d5c6bf5091acc8a7cc81ce223a78a78/aruudy-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "614c5b90735317ff143e3aabe0e3d516", "sha256": "8cb629c180cf6e2617985f89fa56a3f2058169743eb91ef38eaad5add5354181" }, "downloads": -1, "filename": "aruudy-0.4.0.tar.gz", "has_sig": false, "md5_digest": "614c5b90735317ff143e3aabe0e3d516", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15755, "upload_time": "2019-01-18T19:43:41", "url": "https://files.pythonhosted.org/packages/cc/39/dbc8d64d22b28bdd72e060ef88f70f54c5ebccaaa0ab672d0f739a6f974f/aruudy-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "08fdcac0873ee31f47e951fbad412df7", "sha256": "6c51971014e65ed1155782be824a45b33ce07d3c79e49be524f37d22a689dd2d" }, "downloads": -1, "filename": "aruudy-0.4.1.tar.gz", "has_sig": false, "md5_digest": "08fdcac0873ee31f47e951fbad412df7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17197, "upload_time": "2019-01-18T20:05:17", "url": "https://files.pythonhosted.org/packages/2f/b3/93767266f693ef5095f7fc9bf6cf840254c2a9a5e39714f18e431602e3a3/aruudy-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "08fdcac0873ee31f47e951fbad412df7", "sha256": "6c51971014e65ed1155782be824a45b33ce07d3c79e49be524f37d22a689dd2d" }, "downloads": -1, "filename": "aruudy-0.4.1.tar.gz", "has_sig": false, "md5_digest": "08fdcac0873ee31f47e951fbad412df7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17197, "upload_time": "2019-01-18T20:05:17", "url": "https://files.pythonhosted.org/packages/2f/b3/93767266f693ef5095f7fc9bf6cf840254c2a9a5e39714f18e431602e3a3/aruudy-0.4.1.tar.gz" } ] }