Skip to main content

Sylajone: Arabic syntax Analyzer library

Project description

Sylajone: Arabic syntax Analyzer library

مكتبة سيلجون للتحليل النحوي

Sylajone: Arabic syntax Analyzer library

sylajone logo

sylajone logo

PyPI - Downloads

PyPI - Downloads

Developpers: Taha Zerrouki: http://tahadz.com taha dot zerrouki at gmail dot com

Features

value

Authors

Authors.md

Release

0.1

License

GPL

Tracker

linuxscout/sylajone/Issues

Source

Github

Feedbacks

Comments

Accounts

[@Twitter](https://twitter.com/linuxscout))

Description

Sylajone: Arabic syntax Analyzer library

مزايا:

  • استخلاص العلاقات النحوية بين ثنائيات الكلمات : (فعل -فاعل، فعل-مفعول به، ناصب منصوب، جار مجرور)

install

pip install sylajone

Usage

import
pip install sylajone
Test
>>> import sylajone.anasyn as asn
>>> import pprint
>>>
>>> text  =  u"يعبد الله منذ أن تطلع الشمس"
>>> result  =  []
>>> anasyn  =  asn.SyntaxAnalyzer()
>>> result  =  anasyn.analyze_text(text)
>>> anasyn.pprint(result)
  • Extract semantic relation, display only found relations

>>> import pprint
>>> syn_result = anasyn.display_syn(result)
>>> pprint.pprint(syn_result)
[[['اللهَ', 'يُعَبِّدَ', 'اللهُ', 'عَبَّدَ', 20],
  ['اللهَ', 'يُعَبِّدُ', 'اللهُ', 'عَبَّدَ', 20],
  ['اللهَ', 'يُعَبِّدْ', 'اللهُ', 'عَبَّدَ', 20],
  ['اللهَ', 'يَعْبُدَ', 'اللهُ', 'عَبَدَ', 20],
  ['اللهَ', 'يَعْبُدُ', 'اللهُ', 'عَبَدَ', 20],
  ['اللهَ', 'يَعْبُدْ', 'اللهُ', 'عَبَدَ', 20],
  ['اللهُ', 'يُعَبِّدَ', 'اللهُ', 'عَبَّدَ', 10],
...
  • Extract semantic relation, display all words and tags

    >>> syn_result = anasyn.display_syn(result, all=True)
    >>> pprint.pprint(syn_result)
    [('يعبد', 'B', []),
     ('الله',
      'I',
      [['اللهَ', 'يُعَبِّدَ', 'اللهُ', 'عَبَّدَ', 20],
       ['اللهَ', 'يُعَبِّدُ', 'اللهُ', 'عَبَّدَ', 20],
       ['اللهَ', 'يُعَبِّدْ', 'اللهُ', 'عَبَّدَ', 20],
       ['اللهَ', 'يَعْبُدَ', 'اللهُ', 'عَبَدَ', 20],
       ['اللهَ', 'يَعْبُدُ', 'اللهُ', 'عَبَدَ', 20],
       ['اللهَ', 'يَعْبُدْ', 'اللهُ', 'عَبَدَ', 20],
       ['اللهُ', 'يُعَبِّدَ', 'اللهُ', 'عَبَّدَ', 10],
    ...
    >>>
  • convert to pandas ```python >>> # convert to pandas … import pandas as pd >>> # flatten the result … df = pd.DataFrame(anasyn.decode(result)) >>> print(df.head()) action affix affix_key forced_word_case … unvocalized unvoriginal vocalized word 0 -ي– -ي–|المضارع المنصوب:هو:y False … يعبد عبد يُعَبِّدَ يعبد 1 -ي– -ي–|المضارع المجهول المجزوم:هو:y False … يعبد عبد يُعَبَّدْ يعبد 2 -ي– -ي–|المضارع المجهول:هو:y False … يعبد عبد يُعَبَّدُ يعبد 3 -ي– -ي–|المضارع المعلوم:هو:y False … يعبد عبد يُعَبِّدُ يعبد 4 -ي– -ي–|المضارع المجزوم:هو:y False … يعبد عبد يُعَبِّدْ يعبد

[5 rows x 50 columns] >>> df.to_csv(“output/test.csv”, encoding=”utf8”, sep=”:raw-latex:’t’”)

[requirement]
1. CodernityDB>=0.5.0   /  CodernityDB3>=0.6.0
2. libqutrub>=1.2.4.1
3. naftawayh>=0.4
4. pyarabic>=0.6.8
5. qalsadi>=0.3.5

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

sylajone-0.3.1.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

sylajone-0.3.1-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

Details for the file sylajone-0.3.1.tar.gz.

File metadata

  • Download URL: sylajone-0.3.1.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.9 CPython/2.7.12

File hashes

Hashes for sylajone-0.3.1.tar.gz
Algorithm Hash digest
SHA256 5c8186a6dec280dcf4d604d3cf1619df3bd78c35f766dc082f73638f2d55183e
MD5 02c0afa7a194ab418f21d913243bcd3b
BLAKE2b-256 95bc50239a8953f185d6dbb0cced4988e6b1a396b358ceada871657a1156e58c

See more details on using hashes here.

File details

Details for the file sylajone-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: sylajone-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.9 CPython/2.7.12

File hashes

Hashes for sylajone-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 feb01d94344c3be942e700cf5bfd409d75a805ac439d66a1e0479a45a87f9fd5
MD5 09654dec38258c408e0e7f982dbef96e
BLAKE2b-256 eb1779f4f43bda59a40749ed3881f6089508337f14a0393bf30c9b9a239dbb7f

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