Sylajone: Arabic syntax Analyzer library
مكتبة سيلجون للتحليل النحوي
Sylajone: Arabic syntax Analyzer library
sylajone logo
PyPI - Downloads
Developpers: Taha Zerrouki: http://tahadz.com taha dot zerrouki at gmail dot com
Features |
value |
|---|---|
Authors |
|
Release |
0.1 |
License |
|
Tracker |
|
Source |
|
Feedbacks |
|
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
Metadata
Release files for sylajone 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sylajone-0.3.1.tar.gz | 25.2 kB | Without provenance | Details for sylajone-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sylajone-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for sylajone-0.3.1-py3-none-any.whl |
Total release size: 62.5 kB
Release files / sylajone-0.3.1.tar.gz
| Download URL | sylajone-0.3.1.tar.gz |
|---|---|
| Size | 25.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c8186a6dec280dcf4d604d3cf1619df3bd78c35f766dc082f73638f2d55183e
|
|
BLAKE2b-256 checksum How to use checksums |
95bc50239a8953f185d6dbb0cced4988e6b1a396b358ceada871657a1156e58c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / sylajone-0.3.1-py3-none-any.whl
| Download URL | sylajone-0.3.1-py3-none-any.whl |
|---|---|
| Size | 37.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
feb01d94344c3be942e700cf5bfd409d75a805ac439d66a1e0479a45a87f9fd5
|
|
BLAKE2b-256 checksum How to use checksums |
eb1779f4f43bda59a40749ed3881f6089508337f14a0393bf30c9b9a239dbb7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for sylajone 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.