# Mysam: Arabic tags manager, ميسم: إدارة الوسوم العربية
تسيير وسوم الكلمات العربية في مجال المعالجة الآلية للغة، ترميز وتفكيك
هذه المكتبة توفر سكريبت خاصا بترميز وسوم الكلمات (الخصائص الصرفية والنحوية والدلالية) في عبارة وسم مختصرة على شكل سلسلة حروف قصيرة مرمّزة نسميها سلسلة الوسوم.
يمكن التحويل بين قائمة الوسوم وسلسة الوسوم المختص
يمكن الاستفادة من هذه المكتبة من أجل ترميز الوسوم وفك ترميزها، سنستعملها في :
* التحليل الصرفي ([مكتبة قلصادي](https://github.com/linuxscout/qalsadi) )
* التحليل النحوي ( [مكتبة ثعلب](https://github.com/linuxscout/thaalab-aranasyn) )
* التشكيل ( برنامج مشكال[برنامج مشكال](https://github.com/linuxscout/mishkal) [ برنامج مشكال](http://tahadz.com/mishkal) )
* التدقيق اللغوي النحوي (LanguageTool).
كما تقدّم خدمة متميزة في **الإعراب بالطريقة القديمة **
![TAG STRINGS](doc/images/mysam_sample.png "Example")
* قائمة الوسوم :
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:
* Morphology analysis ([Qalsadi library](https://github.com/linuxscout/qalsadi) )
* Syntactic analysis ( [Thaalab Library](https://github.com/linuxscout/thaalab-aranasyn) )
* Tashkeel ( [Mishkal](https://github.com/linuxscout/mishkal) [Mishkal-site](http://tahadz.com/mishkal) )
* LanguageTool - Style and Grammar Checker [LanguageTool](https://languagetool.org/).
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](doc/tagset.md)
Developpers: Taha Zerrouki: http://tahadz.com
taha dot zerrouki at gmail dot com
Features | value
------------|-----------
Authors | Taha Zerrouki: http://tahadz.com, taha dot zerrouki at gmail dot com
Release | 0.4
License |[GPL](https://github.com/linuxscout/mysam-tagmanager/master/LICENSE)
Tracker |[linuxscout/mysam-tagmanager/Issues](https://github.com/linuxscout/mysam-tagmanager/issues)
Website |[https://pypi.python.org/pypi/mysam-tagmanager](https://pypi.python.org/pypi/mysam-tagmanager)
Source |[Github](http://github.com/linuxscout/mysam-tagmanager)
Feedbacks |[Comments](https://github.com/linuxscout/mysam-tagmanager/issues)
Accounts |[@Twitter](https://twitter.com/linuxscout) [@Sourceforge](http://sourceforge.net/projects/mysam-tagmanager/)
<!--Doc |[package Documentaion](http://pythonhosted.org/mysam-tagmanager/)-->
<!--Download |[pypi.python.org](https://pypi.python.org/pypi/mysam-tagmanager)-->
## Citation
If you would cite it in academic work, can you use this citation
```
T. Zerrouki, mysam-tagmanager, Arabic Word Tagger,
https://pypi.python.org/pypi/mysam-tagmanager/, 2018
```
or in bibtex format
```bibtex
@misc{zerrouki2018mysam,
title={mysam-tagmanager : Arabic Word Tagger},
author={Zerrouki, Taha},
url={https://pypi.python.org/pypi/mysam-tagmanager,
year={2018}
}
```
## مزايا
* ترميز المزايا إلى وسم موحد مختصر
* تفكيك الوسم إلى خصائصه
* توليد الإعراب حسب الطريق التقليدية
## 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 جرّب
يمكن التجربة على [موقع مشكال](http://tahadz.com/mishkal)
، اختر تشكيل، ثم مرّر الفأرة على الكلمة لرؤية التلميح
You can test it on [Mishkal Site](http://tahadz.com/mishkal), choose: Tashkeel, and move mouse over word to get hint.
![mysam-tagmanager Demo](doc/images/mysam_demo.png)
Installation
=====
```python
pip install mysam-tagmanager
```
## Usage
```python
import mysam.tagmaker as tagmaker
```
## Example
### Test load configuration
```python
import pandas as pd
import mysam.tagconfig as tagconfig
import mysam.tag_const as tag_const
configuer = tagconfig.tagConfig()
configuer.load_config()
# display
df = pd.DataFrame(configuer.tagsdict)
print('****tagdict ****')
print(df)
*****Result *****
****tagdict ****
اسم Noun فعل Verb أداة ... 1st person مخاطب 2nd person غائب 3rd person
part 1 1 1 1 1 ... 4 4 4 4 4
pos 1 1 1 1 1 ... 4 4 4 4 4
attr word_type word_type word_type word_type word_type ... person person person person person
ar_attr نوع الكلمة نوع الكلمة نوع الكلمة نوع الكلمة نوع الكلمة ... شخص شخص شخص شخص شخص
code n n V V T ... I Y Y H H
value Noun Noun Verb Verb Tool ... 1st person 2nd person 2nd person 3rd person 3rd person
ar_value اسم اسم فعل فعل أداة ... متكلم مخاطب مخاطب غائب غائب
inflect اسم اسم فعل فعل حرف ...
[8 rows x 95 columns]
....
....
```
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.
```python
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'
```python
configuer = tagconfig.tagConfig()
configuer.load_config("tag.config", debug=True)
```
### Test call tagmaker
```python
import mysam.tagcoder
# given tags as list
taglists = [[u'اسم', u'هاء', u'مجرور',],
u'تعريف::مرفوع:متحرك:ينون:::'.split(":"),
]
tgcoder = mysam.tagcoder.tagCoder()
for taglist in taglists:
# encode
tagcode = tgcoder.encode(taglist)
print("tags list:", u";".join(taglist))
print("tagcode:", tagcode)
# decode a tag code string into (key, values)
print("decode:", tgcoder.decode(tagcode))
**** result ****
tags list: اسم;هاء;مجرور
tagcode: N--;------I;---
decode: [('نوع الكلمة', 'اسم'), ('خاصية', 'لاشيء'), ('جنس', 'لاشيء'), ('عدد', 'لاشيء'), ('شخص', 'لاشيء'), ('علامة', 'لاشيء'), ('زمن', 'لاشيء'), ('بناء', 'لاشيء'), ('إعراب', 'مجرور'), ('عطف', 'لاشيء'), ('استقبال', 'لاشيء'), ('ضمير متصل', 'لاشيء')]
tags list: تعريف;;مرفوع;متحرك;ينون;;;
tagcode: ---;------U;--L
decode: [('نوع الكلمة', 'لاشيء'), ('خاصية', 'لاشيء'), ('جنس', 'لاشيء'), ('عدد', 'لاشيء'), ('شخص', 'لاشيء'), ('علامة', 'لاشيء'), ('زمن', 'لاشيء'), ('بناء', 'لاشيء'), ('إعراب', 'مرفوع'), ('عطف', 'لاشيء'), ('استقبال', 'لاشيء'), ('تعريف', 'معرفة')]
```
### Exmaple for inflect
```python
import mysam.taginflector
tag_maker = mysam.taginflector.tagInflector()
word = "يَسْتَعْمِلُونَهَا"
tagcode = 'V-1;M3H-faU;W-H'
print(tag_maker.inflect(tagcode))
**** result ****
فعل مضارع مرفوع وعلامة رفعه ثبوت النون لأنه من الأفعال الخمسة والواو: ضمير متصل مبني في محل رفع فاعل والضمير المتصل مبني في محل نصب مفعول به
```
### Exmaple for add tag
Add a new tag to existing tags string code
```python
import mysam.tagcoder
tag_coder = mysam.tagcoder.tagCoder()
tagcode = 'V-0;M1H-faU;W--'
tag = "ضمير متصل"
print(tag_coder.add_tag(tag, tagcode))
**** result ****
V-0;M1H-faU;W-H
```
### Exmaple for remove tag
Remove and a tag from existing tags string code
```python
import mysam.tagcoder
tag_coder = mysam.tagcoder.tagCoder()
tagcode = 'V-0;M1H-faU;W-H'
tag = "ضمير متصل"
print(tag_coder.remove_tag(tag, tagcode))
**** result ****
V-0;M1H-faU;W--
```
###
### Exmaple for has tag
```python
import mysam.tagcoder
tag_coder = mysam.tagcoder.tagCoder()
tags = ['اسم', 'مجرور', 'مذكر', "مفرد", "واو"]
tagcode = tag_coder.encode(tags)
print(tagcode)
tag_search = u"مجرور"
print(tag_coder.has_tag(tag_search, tagcode))
tag_search = u"فعل"
print(tag_coder.has_tag(tag_search, tagcode))
**** result ****
N--;M1----I;---
True
False
```
Raw data
{
"_id": null,
"home_page": "http://pypi.python.com/projects/mysam-tagmanager/",
"name": "mysam-tagmanager",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Taha Zerrouki",
"author_email": "taha_zerrouki@hotmail.com",
"download_url": "",
"platform": null,
"description": "# Mysam: Arabic tags manager, \u0645\u064a\u0633\u0645: \u0625\u062f\u0627\u0631\u0629 \u0627\u0644\u0648\u0633\u0648\u0645 \u0627\u0644\u0639\u0631\u0628\u064a\u0629\n\n\u062a\u0633\u064a\u064a\u0631 \u0648\u0633\u0648\u0645 \u0627\u0644\u0643\u0644\u0645\u0627\u062a \u0627\u0644\u0639\u0631\u0628\u064a\u0629 \u0641\u064a \u0645\u062c\u0627\u0644 \u0627\u0644\u0645\u0639\u0627\u0644\u062c\u0629 \u0627\u0644\u0622\u0644\u064a\u0629 \u0644\u0644\u063a\u0629\u060c \u062a\u0631\u0645\u064a\u0632 \u0648\u062a\u0641\u0643\u064a\u0643\n\u0647\u0630\u0647 \u0627\u0644\u0645\u0643\u062a\u0628\u0629 \u062a\u0648\u0641\u0631 \u0633\u0643\u0631\u064a\u0628\u062a \u062e\u0627\u0635\u0627 \u0628\u062a\u0631\u0645\u064a\u0632 \u0648\u0633\u0648\u0645 \u0627\u0644\u0643\u0644\u0645\u0627\u062a (\u0627\u0644\u062e\u0635\u0627\u0626\u0635 \u0627\u0644\u0635\u0631\u0641\u064a\u0629 \u0648\u0627\u0644\u0646\u062d\u0648\u064a\u0629 \u0648\u0627\u0644\u062f\u0644\u0627\u0644\u064a\u0629) \u0641\u064a \u0639\u0628\u0627\u0631\u0629 \u0648\u0633\u0645 \u0645\u062e\u062a\u0635\u0631\u0629 \u0639\u0644\u0649 \u0634\u0643\u0644 \u0633\u0644\u0633\u0644\u0629 \u062d\u0631\u0648\u0641 \u0642\u0635\u064a\u0631\u0629 \u0645\u0631\u0645\u0651\u0632\u0629 \u0646\u0633\u0645\u064a\u0647\u0627 \u0633\u0644\u0633\u0644\u0629 \u0627\u0644\u0648\u0633\u0648\u0645.\n\u064a\u0645\u0643\u0646 \u0627\u0644\u062a\u062d\u0648\u064a\u0644 \u0628\u064a\u0646 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0648\u0633\u0648\u0645 \u0648\u0633\u0644\u0633\u0629 \u0627\u0644\u0648\u0633\u0648\u0645 \u0627\u0644\u0645\u062e\u062a\u0635\n\u064a\u0645\u0643\u0646 \u0627\u0644\u0627\u0633\u062a\u0641\u0627\u062f\u0629 \u0645\u0646 \u0647\u0630\u0647 \u0627\u0644\u0645\u0643\u062a\u0628\u0629 \u0645\u0646 \u0623\u062c\u0644 \u062a\u0631\u0645\u064a\u0632 \u0627\u0644\u0648\u0633\u0648\u0645 \u0648\u0641\u0643 \u062a\u0631\u0645\u064a\u0632\u0647\u0627\u060c \u0633\u0646\u0633\u062a\u0639\u0645\u0644\u0647\u0627 \u0641\u064a\u00a0:\n\n * \u0627\u0644\u062a\u062d\u0644\u064a\u0644 \u0627\u0644\u0635\u0631\u0641\u064a ([\u0645\u0643\u062a\u0628\u0629 \u0642\u0644\u0635\u0627\u062f\u064a](https://github.com/linuxscout/qalsadi) )\n * \u0627\u0644\u062a\u062d\u0644\u064a\u0644 \u0627\u0644\u0646\u062d\u0648\u064a ( [\u0645\u0643\u062a\u0628\u0629 \u062b\u0639\u0644\u0628](https://github.com/linuxscout/thaalab-aranasyn) )\n * \u0627\u0644\u062a\u0634\u0643\u064a\u0644 ( \u0628\u0631\u0646\u0627\u0645\u062c \u0645\u0634\u0643\u0627\u0644[\u0628\u0631\u0646\u0627\u0645\u062c \u0645\u0634\u0643\u0627\u0644](https://github.com/linuxscout/mishkal) [ \u0628\u0631\u0646\u0627\u0645\u062c \u0645\u0634\u0643\u0627\u0644](http://tahadz.com/mishkal) )\n * \u0627\u0644\u062a\u062f\u0642\u064a\u0642 \u0627\u0644\u0644\u063a\u0648\u064a \u0627\u0644\u0646\u062d\u0648\u064a (LanguageTool).\n\n\u0643\u0645\u0627 \u062a\u0642\u062f\u0651\u0645 \u062e\u062f\u0645\u0629 \u0645\u062a\u0645\u064a\u0632\u0629 \u0641\u064a **\u0627\u0644\u0625\u0639\u0631\u0627\u0628 \u0628\u0627\u0644\u0637\u0631\u064a\u0642\u0629 \u0627\u0644\u0642\u062f\u064a\u0645\u0629 **\n\n![TAG STRINGS](doc/images/mysam_sample.png \"Example\")\n\n* \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0648\u0633\u0648\u0645\u00a0:\n Noun, \u062c\u0627\u0645\u062f, \u0645\u0636\u0627\u0641, \u0645\u062c\u0631\u0648\u0631, \u0645\u062a\u062d\u0631\u0643, \u064a\u0646\u0648\u0646\n* \u0633\u0644\u0633\u0644\u0629 \u0627\u0644\u0648\u0633\u0648\u0645 \u0627\u0644\u0645\u062e\u062a\u0635\u0631\u0629\n [N--;--I-;---H;----]\n* \u062c\u0645\u0644\u0629 \u0627\u0644\u0625\u0639\u0631\u0627\u0628\n{\u0627\u0633\u0645 \u0645\u062c\u0631\u0648\u0631 \u0648\u0647\u0648 \u0645\u0636\u0627\u0641\u060c \u0648\u0627\u0644\u0636\u0645\u064a\u0631 \u0627\u0644\u0645\u062a\u0635\u0644 \u0645\u0628\u0646\u064a \u0641\u064a \u0645\u062d\u0644 \u062c\u0631 \u0645\u0636\u0627\u0641 \u0625\u0644\u064a\u0647}\n\n** \u0647\u0630\u0647 \u0644\u064a\u0633\u062a \u0645\u0643\u062a\u0628\u0629 \u0644\u0644\u062a\u0648\u0633\u064a\u0645\u060c \u0628\u0644 \u0644\u0625\u062f\u0627\u0631\u0629 \u0627\u0644\u0648\u0633\u0648\u0645 \u0641\u064a \u0645\u0639\u0627\u0644\u062c\u0629 \u0627\u0644\u0644\u063a\u0629**\n\n\nManage arabic words tags, encode, decode\nThis library provides a script to encode POS tags (Words features : morphology, syntax, semantic), as a brief tag string called tag string.\nWe can convert between tag list <==> coded tag string.\nWe plan to use it in:\n\n * Morphology analysis ([Qalsadi library](https://github.com/linuxscout/qalsadi) )\n * Syntactic analysis ( [Thaalab Library](https://github.com/linuxscout/thaalab-aranasyn) )\n * Tashkeel ( [Mishkal](https://github.com/linuxscout/mishkal) [Mishkal-site](http://tahadz.com/mishkal) )\n * LanguageTool - Style and Grammar Checker [LanguageTool](https://languagetool.org/).\n\nIt provides a special feature, make **traditional Inflection**.\n\nThe conversion can be do like:\n\n * Tags list:\n Noun, \u062c\u0627\u0645\u062f, \u0645\u0636\u0627\u0641, \u0645\u062c\u0631\u0648\u0631, \u0645\u062a\u062d\u0631\u0643, \u064a\u0646\u0648\u0646\n * Encoded tag string\n [N--;--I-;---H;----]\n * Inflection phrase\n{\u0627\u0633\u0645 \u0645\u062c\u0631\u0648\u0631 \u0648\u0647\u0648 \u0645\u0636\u0627\u0641\u060c \u0648\u0627\u0644\u0636\u0645\u064a\u0631 \u0627\u0644\u0645\u062a\u0635\u0644 \u0645\u0628\u0646\u064a \u0641\u064a \u0645\u062d\u0644 \u062c\u0631 \u0645\u0636\u0627\u0641 \u0625\u0644\u064a\u0647}\n\n** This not a Tagger library, but, a tags mangger for NLP **\n\n\n### Tagging System description\nYou can look at tagging descripton on [doc/tagset.md](doc/tagset.md)\n\n\n Developpers: Taha Zerrouki: http://tahadz.com\n taha dot zerrouki at gmail dot com\n\nFeatures | value\n------------|-----------\nAuthors | Taha Zerrouki: http://tahadz.com, taha dot zerrouki at gmail dot com\nRelease | 0.4 \nLicense |[GPL](https://github.com/linuxscout/mysam-tagmanager/master/LICENSE)\nTracker |[linuxscout/mysam-tagmanager/Issues](https://github.com/linuxscout/mysam-tagmanager/issues)\nWebsite |[https://pypi.python.org/pypi/mysam-tagmanager](https://pypi.python.org/pypi/mysam-tagmanager)\nSource |[Github](http://github.com/linuxscout/mysam-tagmanager)\nFeedbacks |[Comments](https://github.com/linuxscout/mysam-tagmanager/issues)\nAccounts |[@Twitter](https://twitter.com/linuxscout) [@Sourceforge](http://sourceforge.net/projects/mysam-tagmanager/)\n\n<!--Doc |[package Documentaion](http://pythonhosted.org/mysam-tagmanager/)-->\n<!--Download |[pypi.python.org](https://pypi.python.org/pypi/mysam-tagmanager)-->\n\n## Citation\nIf you would cite it in academic work, can you use this citation\n```\nT. Zerrouki\u200f, mysam-tagmanager, Arabic Word Tagger,\n https://pypi.python.org/pypi/mysam-tagmanager/, 2018\n```\nor in bibtex format\n\n```bibtex\n@misc{zerrouki2018mysam,\n title={mysam-tagmanager : Arabic Word Tagger},\n author={Zerrouki, Taha},\n url={https://pypi.python.org/pypi/mysam-tagmanager,\n year={2018}\n}\n```\n\n\n## \u0645\u0632\u0627\u064a\u0627\n* \u062a\u0631\u0645\u064a\u0632 \u0627\u0644\u0645\u0632\u0627\u064a\u0627 \u0625\u0644\u0649 \u0648\u0633\u0645 \u0645\u0648\u062d\u062f \u0645\u062e\u062a\u0635\u0631\n* \u062a\u0641\u0643\u064a\u0643 \u0627\u0644\u0648\u0633\u0645 \u0625\u0644\u0649 \u062e\u0635\u0627\u0626\u0635\u0647\n* \u062a\u0648\u0644\u064a\u062f \u0627\u0644\u0625\u0639\u0631\u0627\u0628 \u062d\u0633\u0628 \u0627\u0644\u0637\u0631\u064a\u0642 \u0627\u0644\u062a\u0642\u0644\u064a\u062f\u064a\u0629\n\n## Features\n* Encode features to an unified tag string\n* Encode unified tag string to a list of features\n* Generate a traditional inflection style\n\n## Applications\n* Text summarizing.\n* Sentences identification.\n* Grammar analysis.\n* Morphological analysis.\n\n## \u062a\u0637\u0628\u064a\u0642\u0627\u062a \n* \u0627\u0644\u062a\u0646\u0642\u064a\u0628 \u0639\u0646 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a.\n* \u0627\u0644\u062a\u0639\u0631\u0641 \u0639\u0644\u0649 \u0627\u0644\u062c\u0645\u0644.\n* \u0627\u0644\u062a\u062d\u0644\u064a\u0644 \u0627\u0644\u0646\u062d\u0648\u064a.\n* \u062a\u0633\u0631\u064a\u0639 \u0627\u0644\u062a\u062d\u0644\u064a\u0644 \u0627\u0644\u0635\u0631\u0641\u064a.\n\n\n\n## Demo \u062c\u0631\u0651\u0628\n\n\u064a\u0645\u0643\u0646 \u0627\u0644\u062a\u062c\u0631\u0628\u0629 \u0639\u0644\u0649 [\u0645\u0648\u0642\u0639 \u0645\u0634\u0643\u0627\u0644](http://tahadz.com/mishkal)\n\u060c \u0627\u062e\u062a\u0631 \u062a\u0634\u0643\u064a\u0644\u060c \u062b\u0645 \u0645\u0631\u0651\u0631 \u0627\u0644\u0641\u0623\u0631\u0629 \u0639\u0644\u0649 \u0627\u0644\u0643\u0644\u0645\u0629 \u0644\u0631\u0624\u064a\u0629 \u0627\u0644\u062a\u0644\u0645\u064a\u062d\n\nYou can test it on [Mishkal Site](http://tahadz.com/mishkal), choose: Tashkeel, and move mouse over word to get hint.\n\n![mysam-tagmanager Demo](doc/images/mysam_demo.png)\n\nInstallation\n=====\n```python\npip install mysam-tagmanager\n```\n## Usage\n\n```python\nimport mysam.tagmaker as tagmaker\n```\n## Example\n\n### Test load configuration\n\n```python\nimport pandas as pd\n\nimport mysam.tagconfig as tagconfig\nimport mysam.tag_const as tag_const\n\nconfiguer = tagconfig.tagConfig()\nconfiguer.load_config()\n# display\ndf = pd.DataFrame(configuer.tagsdict)\nprint('****tagdict ****')\nprint(df)\n*****Result *****\n****tagdict ****\n \u0627\u0633\u0645 Noun \u0641\u0639\u0644 Verb \u0623\u062f\u0627\u0629 ... 1st person \u0645\u062e\u0627\u0637\u0628 2nd person \u063a\u0627\u0626\u0628 3rd person\npart 1 1 1 1 1 ... 4 4 4 4 4\npos 1 1 1 1 1 ... 4 4 4 4 4\nattr word_type word_type word_type word_type word_type ... person person person person person\nar_attr \u0646\u0648\u0639 \u0627\u0644\u0643\u0644\u0645\u0629 \u0646\u0648\u0639 \u0627\u0644\u0643\u0644\u0645\u0629 \u0646\u0648\u0639 \u0627\u0644\u0643\u0644\u0645\u0629 \u0646\u0648\u0639 \u0627\u0644\u0643\u0644\u0645\u0629 \u0646\u0648\u0639 \u0627\u0644\u0643\u0644\u0645\u0629 ... \u0634\u062e\u0635 \u0634\u062e\u0635 \u0634\u062e\u0635 \u0634\u062e\u0635 \u0634\u062e\u0635\ncode n n V V T ... I Y Y H H\nvalue Noun Noun Verb Verb Tool ... 1st person 2nd person 2nd person 3rd person 3rd person\nar_value \u0627\u0633\u0645 \u0627\u0633\u0645 \u0641\u0639\u0644 \u0641\u0639\u0644 \u0623\u062f\u0627\u0629 ... \u0645\u062a\u0643\u0644\u0645 \u0645\u062e\u0627\u0637\u0628 \u0645\u062e\u0627\u0637\u0628 \u063a\u0627\u0626\u0628 \u063a\u0627\u0626\u0628\ninflect \u0627\u0633\u0645 \u0627\u0633\u0645 \u0641\u0639\u0644 \u0641\u0639\u0644 \u062d\u0631\u0641 ... \n\n[8 rows x 95 columns]\n....\n....\n\n```\nYou can load a specific config file by passing parameter to load_conf.\nIf the file doesn't exist or failed to be open, the default config is loaded.\n\n```python\nconfiguer = tagconfig.tagConfig()\nconfiguer.load_config(\"tag.config\")\n\n```\nIf you want to know if the input file is opened, fix 'debug' parameter to 'True'\n\n\nIf you want to know if the input file is open, fix 'debug' parameter to 'True'\n```python\nconfiguer = tagconfig.tagConfig()\nconfiguer.load_config(\"tag.config\", debug=True)\n```\n\n### Test call tagmaker\n\n```python\nimport mysam.tagcoder\n# given tags as list \ntaglists = [[u'\u0627\u0633\u0645', u'\u0647\u0627\u0621', u'\u0645\u062c\u0631\u0648\u0631',],\n u'\u062a\u0639\u0631\u064a\u0641::\u0645\u0631\u0641\u0648\u0639:\u0645\u062a\u062d\u0631\u0643:\u064a\u0646\u0648\u0646:::'.split(\":\"),\n ]\ntgcoder = mysam.tagcoder.tagCoder()\nfor taglist in taglists:\n # encode\n tagcode = tgcoder.encode(taglist)\n print(\"tags list:\", u\";\".join(taglist))\n print(\"tagcode:\", tagcode)\n # decode a tag code string into (key, values)\n print(\"decode:\", tgcoder.decode(tagcode))\n\n**** result ****\ntags list: \u0627\u0633\u0645;\u0647\u0627\u0621;\u0645\u062c\u0631\u0648\u0631\ntagcode: N--;------I;---\ndecode: [('\u0646\u0648\u0639 \u0627\u0644\u0643\u0644\u0645\u0629', '\u0627\u0633\u0645'), ('\u062e\u0627\u0635\u064a\u0629', '\u0644\u0627\u0634\u064a\u0621'), ('\u062c\u0646\u0633', '\u0644\u0627\u0634\u064a\u0621'), ('\u0639\u062f\u062f', '\u0644\u0627\u0634\u064a\u0621'), ('\u0634\u062e\u0635', '\u0644\u0627\u0634\u064a\u0621'), ('\u0639\u0644\u0627\u0645\u0629', '\u0644\u0627\u0634\u064a\u0621'), ('\u0632\u0645\u0646', '\u0644\u0627\u0634\u064a\u0621'), ('\u0628\u0646\u0627\u0621', '\u0644\u0627\u0634\u064a\u0621'), ('\u0625\u0639\u0631\u0627\u0628', '\u0645\u062c\u0631\u0648\u0631'), ('\u0639\u0637\u0641', '\u0644\u0627\u0634\u064a\u0621'), ('\u0627\u0633\u062a\u0642\u0628\u0627\u0644', '\u0644\u0627\u0634\u064a\u0621'), ('\u0636\u0645\u064a\u0631 \u0645\u062a\u0635\u0644', '\u0644\u0627\u0634\u064a\u0621')]\ntags list: \u062a\u0639\u0631\u064a\u0641;;\u0645\u0631\u0641\u0648\u0639;\u0645\u062a\u062d\u0631\u0643;\u064a\u0646\u0648\u0646;;;\ntagcode: ---;------U;--L\ndecode: [('\u0646\u0648\u0639 \u0627\u0644\u0643\u0644\u0645\u0629', '\u0644\u0627\u0634\u064a\u0621'), ('\u062e\u0627\u0635\u064a\u0629', '\u0644\u0627\u0634\u064a\u0621'), ('\u062c\u0646\u0633', '\u0644\u0627\u0634\u064a\u0621'), ('\u0639\u062f\u062f', '\u0644\u0627\u0634\u064a\u0621'), ('\u0634\u062e\u0635', '\u0644\u0627\u0634\u064a\u0621'), ('\u0639\u0644\u0627\u0645\u0629', '\u0644\u0627\u0634\u064a\u0621'), ('\u0632\u0645\u0646', '\u0644\u0627\u0634\u064a\u0621'), ('\u0628\u0646\u0627\u0621', '\u0644\u0627\u0634\u064a\u0621'), ('\u0625\u0639\u0631\u0627\u0628', '\u0645\u0631\u0641\u0648\u0639'), ('\u0639\u0637\u0641', '\u0644\u0627\u0634\u064a\u0621'), ('\u0627\u0633\u062a\u0642\u0628\u0627\u0644', '\u0644\u0627\u0634\u064a\u0621'), ('\u062a\u0639\u0631\u064a\u0641', '\u0645\u0639\u0631\u0641\u0629')]\n\n```\n\n\n### Exmaple for inflect\n```python \nimport mysam.taginflector\ntag_maker = mysam.taginflector.tagInflector()\nword = \"\u064a\u064e\u0633\u0652\u062a\u064e\u0639\u0652\u0645\u0650\u0644\u064f\u0648\u0646\u064e\u0647\u064e\u0627\"\ntagcode = 'V-1;M3H-faU;W-H'\nprint(tag_maker.inflect(tagcode))\n**** result ****\n\u0641\u0639\u0644 \u0645\u0636\u0627\u0631\u0639 \u0645\u0631\u0641\u0648\u0639 \u0648\u0639\u0644\u0627\u0645\u0629 \u0631\u0641\u0639\u0647 \u062b\u0628\u0648\u062a \u0627\u0644\u0646\u0648\u0646 \u0644\u0623\u0646\u0647 \u0645\u0646 \u0627\u0644\u0623\u0641\u0639\u0627\u0644 \u0627\u0644\u062e\u0645\u0633\u0629 \u0648\u0627\u0644\u0648\u0627\u0648: \u0636\u0645\u064a\u0631 \u0645\u062a\u0635\u0644 \u0645\u0628\u0646\u064a \u0641\u064a \u0645\u062d\u0644 \u0631\u0641\u0639 \u0641\u0627\u0639\u0644 \u0648\u0627\u0644\u0636\u0645\u064a\u0631 \u0627\u0644\u0645\u062a\u0635\u0644 \u0645\u0628\u0646\u064a \u0641\u064a \u0645\u062d\u0644 \u0646\u0635\u0628 \u0645\u0641\u0639\u0648\u0644 \u0628\u0647\n```\n\n### Exmaple for add tag\n\nAdd a new tag to existing tags string code\n\n```python\nimport mysam.tagcoder\ntag_coder = mysam.tagcoder.tagCoder()\ntagcode = 'V-0;M1H-faU;W--'\ntag = \"\u0636\u0645\u064a\u0631 \u0645\u062a\u0635\u0644\"\nprint(tag_coder.add_tag(tag, tagcode))\n**** result ****\nV-0;M1H-faU;W-H\n```\n\n### Exmaple for remove tag\n\nRemove and a tag from existing tags string code\n\n```python\nimport mysam.tagcoder\ntag_coder = mysam.tagcoder.tagCoder()\ntagcode = 'V-0;M1H-faU;W-H'\ntag = \"\u0636\u0645\u064a\u0631 \u0645\u062a\u0635\u0644\"\nprint(tag_coder.remove_tag(tag, tagcode))\n**** result ****\nV-0;M1H-faU;W--\n```\n\n### \n\n### Exmaple for has tag\n\n```python \nimport mysam.tagcoder\ntag_coder = mysam.tagcoder.tagCoder()\ntags = ['\u0627\u0633\u0645', '\u0645\u062c\u0631\u0648\u0631', '\u0645\u0630\u0643\u0631', \"\u0645\u0641\u0631\u062f\", \"\u0648\u0627\u0648\"]\ntagcode = tag_coder.encode(tags)\nprint(tagcode)\ntag_search = u\"\u0645\u062c\u0631\u0648\u0631\"\nprint(tag_coder.has_tag(tag_search, tagcode))\ntag_search = u\"\u0641\u0639\u0644\"\nprint(tag_coder.has_tag(tag_search, tagcode))\n**** result ****\nN--;M1----I;---\nTrue\nFalse\n```\n\n\n\n\n\n\n\n",
"bugtrack_url": null,
"license": "GPL",
"summary": "Mysam: Arabic tags manager",
"version": "0.4",
"project_urls": {
"Homepage": "http://pypi.python.com/projects/mysam-tagmanager/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f926bb4a712aed77c9642fd81dafdc19a92b0cb58e5dccd33c20d3c2f7259c2c",
"md5": "f9cd3931e3a9d867f94a750915d82fb0",
"sha256": "5bc83754a101eaf4fc58f9996923f88e5fa69cea42cbe3dcc50d7294ff37758d"
},
"downloads": -1,
"filename": "mysam_tagmanager-0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f9cd3931e3a9d867f94a750915d82fb0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 37553,
"upload_time": "2023-07-17T06:37:03",
"upload_time_iso_8601": "2023-07-17T06:37:03.418617Z",
"url": "https://files.pythonhosted.org/packages/f9/26/bb4a712aed77c9642fd81dafdc19a92b0cb58e5dccd33c20d3c2f7259c2c/mysam_tagmanager-0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-17 06:37:03",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "mysam-tagmanager"
}