Skip to main content

Mysam: Arabic tags manager

Project description

Mysam: Arabic tags manager, ميسم: إدارة الوسوم العربية

تسيير وسوم الكلمات العربية في مجال المعالجة الآلية للغة، ترميز وتفكيك هذه المكتبة توفر سكريبتا خاصا بترميز وسوم الكلمات (الخصائص الصرفية والنحوية والدلالية) في عبارة وسم مختصرة على شكل سلسلة حروف قصيرة مرمّزة نسميها سلسلة الوسوم. يمكن التحويل بين قائمة الوسوم وسلسة الوسوم المختص يمكن الاستفادة من هذه المكتبة من أجل ترميز الوسوم وفك ترميزها، سنستعملها في :

كما تقدّم خدمة متميزة في الإعراب بالطريقة القديمة

  • قائمة الوسوم : Noun, جامد, مضاف, مجرور, متحرك, ينون

  • سلسلة الوسوم المختصرة [N–;–I-;—H;—-]

  • جملة الإعراب {اسم مجرور وهو مضاف، والضمير المتصل مبني في محل جر مضاف إليه}

** هذه ليست مكتبة للتوسيم، بل لإدارة الوسوم في معالجة اللغة**

Manage arabic words tags, encode, decode This library provides a script to encode POS tags (Words features : morphology, syntax, semantic), as a brief tag string called tag string. We can convert between tag list <==> coded tag string. We plan to use it in:

It provides a special feature, make traditional Inflection.

The conversion can be do like:

  • Tags list: Noun, جامد, مضاف, مجرور, متحرك, ينون

  • Encoded tag string [N–;–I-;—H;—-]

  • Inflection phrase {اسم مجرور وهو مضاف، والضمير المتصل مبني في محل جر مضاف إليه}

** This not a Tagger library, but, a tags mangger for NLP **

Tagging System description

You can look at tagging descripton on doc/tagset.md

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

Features

value

Authors

Taha Zerrouki: http://tahad z.com, taha dot zerrouki at gmail dot com

Release

0.2

License

GPL

Tracker

linuxscout/ mysam-tagman ager/Issues

Website

https://pypi .python.org/ pypi/mysam-t agmanager

Source

Github

Feedbacks

Comments

Accounts

[@Twitter](h ttps://twitt er.com/linux scout) [@Sourceforg e](http://so urceforge.ne t/projects/m ysam-tagmana ger/)

مزايا

  • ترميز المزايا إلى وسم موحد مختصر

  • تفكيك الوسم إلى خصائصه

  • توليد الإعراب حسب الطريق التقليدية

Features

  • Encode features to an unified tag string

  • Encode unified tag string to a list of features

  • Generate a traditional inflection style

Applications

  • Text summarizing.

  • Sentences identification.

  • Grammar analysis.

  • Morphological analysis.

تطبيقات

  • التنقيب عن المعلومات.

  • التعرف على الجمل.

  • التحليل النحوي.

  • تسريع التحليل الصرفي.

Demo جرّب

يمكن التجربة على موقع مشكال ، اختر تشكيل، ثم مرّر الفأرة على الكلمة لرؤية التلميح

You can test it on Mishkal Site, choose: Tashkeel, and move mouse over word to get hint.

Installation

` pip install mysam-tagmanager `

Usage

import mysam.tagmaker as tagmaker

Example

Test load configuration

import mysam.tagconfig as tagconfig
import mysam.tag_const as tag_const
import pandas as pd
configuer = tagconfig.tagConfig()
configuer.load_config()
# display
df = pd.DataFrame(tag_const.TAGSDICT)
print('****tagdict ****')
print(df)
*****Result *****
****tagdict ****
          1st person  2nd person  3rd person          Beh          FEH  \
ar_attr          شخص         شخص         شخص           جر          عطف
ar_value       متكلم       مخاطب        غائب          باء        الفاء
attr          person      person      person  preposition  conjonction
code               I           Y           H            B            F
inflect                                            بالباء
part               4           4           4            3            3
pos                4           4           4            2            1
value     1st person  2nd person  3rd person          Beh          FEH
....
....

You can load a specific config file by passing parameter to load_conf. If the file doesn’t exist or failed to be open, the default config is loaded.

configuer = tagconfig.tagConfig()
configuer.load_config("tag.config")

If you want to know if the input file is opened, fix ‘debug’ parameter to ‘True’

If you want to know if the input file is open, fix ‘debug’ parameter to ‘True’

configuer = tagconfig.tagConfig()
configuer.load_config("tag.config", debug=True)

Test call tagmaker

import mysam.tagmaker as tagmaker

taglists = [[u'اسم', u'هاء', u'مجرور',],
        u'تعريف::مرفوع:متحرك:ينون:::'.split(":"),
        ]
for taglist in taglists:
tag_maker = tagmaker.tagMaker()
# encode
tag_maker.encode(taglist)
print(u"+".join(taglist).encode('utf8'))
tagstr = str(tag_maker)
print(tagstr)
# decode a unifed tag string
print(tag_maker.decode())

**** result ****

اسم+هاء+مجرور
N--;--I-;----;----
[(u'نوع الكلمة', u'اسم'), (u'جنس', u'لاشيء'), (u'عدد', u'لاشيء'), (u'إعراب', u'مجرور'), (u'علامة', u'لاشيء'), (u'عطف', u'لاشيء'), (u'جر', u'لاشيء'), (u'تعريف', u'نكرة'), (u'ضمير متصل', u'لاشيء'), (u'استقبال', u'لاشيء'), (u'بناء', u'لاشيء'), (u'زمن', u'لاشيء'), (u'شخص', u'لاشيء')]
تعريف++مرفوع+متحرك+ينون+++
---;--U-;--L-;----
[(u'نوع الكلمة', u'لاشيء'), (u'جنس', u'لاشيء'), (u'عدد', u'لاشيء'), (u'إعراب', u'مرفوع'), (u'علامة', u'لاشيء'), (u'عطف', u'لاشيء'), (u'جر', u'لاشيء'), (u'تعريف', u'معرفة'), (u'ضمير متصل', u'لاشيء'), (u'استقبال', u'لاشيء'), (u'بناء', u'لاشيء'), (u'زمن', u'لاشيء'), (u'شخص', u'لاشيء')]

Exmaple for inflect

>>> tag_maker = tagmaker.tagMaker()
>>> tagcode = 'N--;--I-;----;---'
>>> print(tag_maker.inflect(tagcode).encode('utf8'))
اسم مجرور وعلامة جرّه الياء لأنه جمع مذكر سالم وهو مضاف، والضمير المتصل مبني في محل جر مضاف إليه

Exmaple for add tag

>>> tag_maker = tagmaker.tagMaker()
>>> tagcode = 'N--;--I-;----;---'
>>> tag_new = u"تعريف"
>>> tag_maker.add(tag_new)
>>> tag_new = u"اسم"
>>> tag_maker.add(tag_new)
>>> print(str(tag_maker).encode('utf8'))
N--;----;--L-;----

Exmaple for has tag

>>> tag_maker = tagmaker.tagMaker()
>>> tagcode = 'N--;--I-;----;---'
>>> tag_search = u"مجرور"
>>> print(tag_maker.has_tag(tag_search, tagcode))
True

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

mysam-tagmanager-0.3.1.tar.gz (16.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mysam_tagmanager-0.3.1-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

mysam_tagmanager-0.3.1-py2-none-any.whl (16.6 kB view details)

Uploaded Python 2

File details

Details for the file mysam-tagmanager-0.3.1.tar.gz.

File metadata

  • Download URL: mysam-tagmanager-0.3.1.tar.gz
  • Upload date:
  • Size: 16.4 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 mysam-tagmanager-0.3.1.tar.gz
Algorithm Hash digest
SHA256 cfff2e2971c9ded17756f2985d410bf3f410c9536ba3f329d210327c18443c9c
MD5 afa87522c2fcedd273bfcd019ad91d1a
BLAKE2b-256 81277b9b868335c9c90042a46640e325488a7e2a2719e5ae1d857a6afeca08a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysam_tagmanager-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 20.6 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 mysam_tagmanager-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9feec8fe1192f3f8cb6a862db0a8bd7a49e548590fdee96dbe8965b48af64f93
MD5 16cbba3c92c7e61ae048d223d619a3fa
BLAKE2b-256 5124af54b4119ab455a97b8c68b12a2584db103a5d9a2b0105c77fe5c782678f

See more details on using hashes here.

File details

Details for the file mysam_tagmanager-0.3.1-py2-none-any.whl.

File metadata

  • Download URL: mysam_tagmanager-0.3.1-py2-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 2
  • 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 mysam_tagmanager-0.3.1-py2-none-any.whl
Algorithm Hash digest
SHA256 2ad1fed87886e8c8110678d67857a41b16316632901d3347d7541f437944b1f9
MD5 c24abec0218d3bf23af79afef0da28ca
BLAKE2b-256 2a92ebc2b09caf96e13c3de49412911081a95be4d0cd95fabaaf3189bf0bbb29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page