Skip to main content

text utility for converting Arabic-scripted text to a completely dediacritised skeleton

Project description

Rasm Arch

Rasm_arch is a text processing utility for converting Arabic-scripted text to a completely dediacritised skeleton.

Rasm_arch is a text processing utility for converting Arabic-scripted text to a completely dediacritised skeleton. If Quranic indexes are given, it can also retrieve Quranic text.

A minimal Rust implementation can be found under src.

Requirements

importlib-metadata>=6.6.0
ujson>=5.1.0

If ujson is not installed, json will be used.

Installation

Install rasm_arch package and rasm_arch command-line utility through pip:

$ $ python -m pip install rasm_arch

Install rasm_arch package and rasm_arch command-line utility along with the man page locally using the makefile:

$ make

Use the following commands to uninstall it:

$ pip uninstall rasm_arch

or

$ python setup.py install --record files.txt
$ xargs rm -rf < files.txt

Examples of usage

In python:

>>> import io
>>> from rasm_arch import rasm_arch as rasm
>>> for ori, rlt, rar, pal in rasm(io.StringIO('کُتِب'), paleo=True):
...   print(ori, rlt, rar, pal)
کُتِب KBB كٮٮ KᵘB²ᵢB₁
>>> import io
>>> from rasm_arch import rasm_arch as rasm
>>> for word, blocks in rasm(((2, 14,15, None), (2, 15, 1, 1)), paleo=True, blocks=True):
...   print(word, *blocks[0], sep='\t')
...   if len(blocks)>1:
...     for block in blocks[1:]:
...         print('-', *block, sep='\t')
نَحۡنُ      نَحۡنُ    BGN   ٮحں   B¹ᵃGᵒN¹ᵘ       (2, 14, 15, 1)
مُسۡتَهۡزِءُونَ مُسۡتَهۡزِءُ MSBHR مسٮهر MᵘSᵒB²ᵃHᵒR¹ᵢʔᵘ (2, 14, 16, 1)
-        و      W     و     W              (2, 14, 16, 2)
-        نَ      N     ں     N¹ᵃ            (2, 14, 16, 3)
ٱ        ٱ      A     ا     Aᵟ              (2, 15, 1, 1)

As a command-line utility:

>>> aspell -d ar dump master | rasm_arch | tail -2
يين  BBN  ٮٮں
ييئس BBBS ٮٮٮس
>>> rasm_arch -q 2:1:4-2:1:5:1 --uniq --json | jq .
[
  {
    "ori": "A",
    "rlt": "ا",
    "rar": 2,
    "frq": [
      "ٱلرَّحِیمِ",
      "ا"
    ]
  },
  {
    "ori": "GBM",
    "rlt": "حٮم",
    "rar": 1,
    "frq": [
      "ٱلرَّحِیمِ"
    ]
  },
  {
    "ori": "LR",
    "rlt": "لر",
    "rar": 1,
    "frq": [
      "ٱلرَّحِیمِ"
    ]
  }
]

License for the code

Rasm_arch is a text processing utility for converting Arabic-scripted text to a completely dediacritised skeleton.

The code for this project is licensed under the MIT License.

Be aware that if you use the Quranic text from rasm, they have two different licences, that you can find below.

MIT License

Copyright (c) 2022 Alicia González Martínez and Thomas Milo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

License for the data

Rasm_arch includes two digitised Quranic texts: The Decotype Quran and the Tanzil Quran.

Decotype Quran

The Decotype Quran is the best encoded Quran with complete orthography and the only digital Quran that has been used to render a printed Quran approved by Al-Azhar.

The Decotype Quran is private.

Tanzil Quran

The Tanzil Quran is the most widely used digital Quran. It was made available by the Tanzil project, https://tanzil.net.

We have included two versions of the Tanzil Quran text:

  • A complete Uthmanic Quran
  • A simplified Quran

Tanzil Quran Text Copyright (C) 2007-2021 Tanzil Project License: Creative Commons Attribution 3.0

This copy of the Quran text is carefully produced, highly verified and continuously monitored by a group of specialists in Tanzil Project.

TERMS OF USE:

  • Permission is granted to copy and distribute verbatim copies of this text, but CHANGING IT IS NOT ALLOWED.

  • This Quran text can be used in any website or application, provided that its source (Tanzil Project) is clearly indicated, and a link is made to tanzil.net to enable users to keep track of changes.

  • This copyright notice shall be included in all verbatim copies of the text, and shall be reproduced appropriately in all files derived from or containing substantial portion of this text.

Please check updates at: http://tanzil.net/updates/

Contact

Alicia González Martínez , aliciagm85+kabikaj at gmail dot com

Project details


Download files

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

Source Distribution

rasm_arch-1.0.1.tar.gz (760.1 kB view details)

Uploaded Source

Built Distribution

rasm_arch-1.0.1-py3-none-any.whl (800.7 kB view details)

Uploaded Python 3

File details

Details for the file rasm_arch-1.0.1.tar.gz.

File metadata

  • Download URL: rasm_arch-1.0.1.tar.gz
  • Upload date:
  • Size: 760.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for rasm_arch-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9c3f93cb3ae0a24d93ae2b3f7a30baa3db860d8f618cc3ff909c3a3e87f53b90
MD5 01688bfcf9c93eaad30420447226cb3a
BLAKE2b-256 6c7132d0f0a4e697bfacb46856beb73700dc030f0b4c9460bada7168c9100705

See more details on using hashes here.

File details

Details for the file rasm_arch-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: rasm_arch-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 800.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for rasm_arch-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1858bf9e42f5706086259c0cc9342d4438ef3aa4c7a91c3084b272d5591d164c
MD5 165c2002c28b9959cc4fbf4f87f16d1d
BLAKE2b-256 34b34b98a2ce6786a127e344385a9eda64f5847cfb41caa0e0a8f294a4a80cec

See more details on using hashes here.

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