{"id":13723272,"url":"https://github.com/AsoSoft/AsoSoft-Library","last_synced_at":"2025-05-07T16:32:40.529Z","repository":{"id":41278319,"uuid":"321884290","full_name":"AsoSoft/AsoSoft-Library","owner":"AsoSoft","description":"AsoSoft's Library for Kurdish language processing tasks","archived":false,"fork":false,"pushed_at":"2023-09-16T14:43:01.000Z","size":357,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-25T14:50:30.975Z","etag":null,"topics":["central-kurdish","kurdish","kurdish-language-processing","natural-language-processing","normalization","sorani","unicode-normalization"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AsoSoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-12-16T06:00:25.000Z","updated_at":"2024-12-09T10:35:25.000Z","dependencies_parsed_at":"2024-01-11T10:57:12.789Z","dependency_job_id":null,"html_url":"https://github.com/AsoSoft/AsoSoft-Library","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.25,"last_synced_commit":"81724c80f8dff8fb7a3f33d6b39631efa681bbb7"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsoSoft%2FAsoSoft-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsoSoft%2FAsoSoft-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsoSoft%2FAsoSoft-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsoSoft%2FAsoSoft-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AsoSoft","download_url":"https://codeload.github.com/AsoSoft/AsoSoft-Library/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252915501,"owners_count":21824578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["central-kurdish","kurdish","kurdish-language-processing","natural-language-processing","normalization","sorani","unicode-normalization"],"created_at":"2024-08-03T01:01:38.292Z","updated_at":"2025-05-07T16:32:35.517Z","avatar_url":"https://github.com/AsoSoft.png","language":"C#","readme":"﻿# AsoSoft Library\nAsoSoft Library offers basic natural language processing (NLP) algorithms for the Kurdish Language (ckb: Central branch of Kurdish).\nAsoSoft Library is written in C#.\n- **Grapheme-to-Phoneme (G2P) converter and Transliteration**: converts Kurdish text into syllabified phoneme string. Also transliterates Kurdish texts from Arabic script into Latin script and vice versa.\n- **Normalizer**: normalizes the Kurdish text and punctuation marks, unifies numerals, replaces Html Entities, extracts and replaces URLs and emails, and more.\n- **Numeral Converter**: converts any type of numbers into Kurdish words.\n- **Sort**: Sorts a list in correct Kurdish alphabet order.\n- **Poem Meter Classifier**: Classifies the meter of the input Kurdish poem \n\n## Grapheme-to-Phoneme (G2P) converter and Transliteration\nThis function is based on the study \"[Automated Grapheme-to-Phoneme Conversion for Central Kurdish based on Optimality Theory](https://www.sciencedirect.com/science/article/abs/pii/S0885230821000292)\". \n\n### Kurdish G2P converter\nConverts Central Kurdish text in standard Arabic script into **syllabified phonemic** Latin script (i.e. graphemes to phonems)\n\nGeneral format:\n```cs\nAsoSoft.G2P(string text, \n            bool convertNumbersToWord = false, \n            bool backMergeConjunction = true, \n            bool singleOutputPerWord = true);\n```\nAn example:\n```cs\nAsoSoft.G2P(\"شەو و ڕۆژ بووین بە گرفت. درێژیی دیوارەکەی گرتن\");\n\u003eˈşeˈwû ˈřoj ˈbûyn ˈbe ˈgiˈrift. ˈdiˈrêˈjîy ˈdîˈwaˈreˈkey ˈgirˈtin\u003c\n```\n### Transliteration\n\nArabic script into Hawar Latin script (ح‌غ‌ڕڵ→ḧẍřł):\n```cs\nAsoSoft.Ar2La(\"گیرۆدەی خاڵی ڕەشتە؛ گوێت لە نەغمەی تویوورە؟\");\n\u003egîrodey xałî řeşte; gwêt le neẍmey tuyûre?\u003c\n```\n\nArabic script into simplified (ح‌غ‌ڕڵ→hxrl) Hawar Latin script:\n```cs\nAsoSoft.Ar2LaSimple(\"گیرۆدەی خاڵی ڕەشتە؛ گوێت لە نەغمەی تویوورە؟\");\n\u003egîrodey xalî reşte; gwêt le nexmey tuyûre?\u003c\n```\n\nLatin script (Hawar) into Arabic script:\n```cs\nAsoSoft.La2Ar(\"Gelî keç û xortên kurdan, hûn hemû bi xêr biçin\");\n\u003eگەلی کەچ و خۆرتێن کوردان، هوون هەموو ب خێر بچن\u003c\n```\n\nArabic script into IPA:\n```cs\nAsoSoft.Phonemes2IPA(AsoSoft.G2P(\"شەو و ڕۆژ بووین بە گرفت. درێژیی دیوارەکە گرتن\"));\n\u003eʃa·wu ro̞ʒ bujn ba gɪ·ɾɪft. dɪ·ɾɛ·ʒij di·wä·ɾa·ka gɪɾ·tɪn\u003c\n```\n## Kurdish Text Normalizer\nSeveral functions needed for Central Kurdish text normalization:\n\n### Normalize Kurdish\nTwo character replacement lists are provided  as the resources of the library:\n- Deep Unicode Corrections:\n  - replacing deprecated Arabic Presentation Forms (FB50–FDFF and FE70–FEFF) with corresponding standard characters.\n  - replacing different types of dashes and spaces\n  - removing Unicode control character\n- Additional Unicode Corrections\n  - replacing special Arabic math signs with corresponding Latin characters\n  - replacing similar, but different letters with standard characters  (e.g. ڪ,ے,ٶ with ک,ی,ؤ)\n\nThe normalization task in this function:\n- for all Arabic scripts (including Kurdish, Arabic, and Persian):\n  - Character-based replacement:\n    - Above mentioned replacement lists\n    - Private Use Area (U+E000 to U+F8FF) with White Square character\n - Standardizing and removing duplicated or unnecessary Zero-Width characters\n - removing unnecessary Tatweels (U+0640)\n- only for Central Kurdish:\n  - standardizing Kurdish characters: ە, هـ, ی, and ک \n  - correcting miss-converted characters from non-Unicode fonts\n  - replacing word-initial ر with ڕ\n\nthe simple overloading:\n```cs\nAsoSoft.Normalize(\"دەقے شیَعري خـــۆش. ره‌نگه‌كاني خاك\");\n\u003eدەقی شێعری خۆش. ڕەنگەکانی خاک\u003c\n```\n\nor the complete overloading:\n```cs\nAsoSoft.Normalize(string text, \n            bool isOnlyKurdish,\n            bool changeInitialR,\n            bool deepUnicodeCorrectios,\n            bool additionalUnicodeCorrections,\n            Dictionary\u003cchar, string\u003e usersReplaceList);\n```\n\n### AliK to Unicode\n`AliK2Unicode` converts Kurdish text written in AliK fonts (developed by Abas Majid in 1997) into Unicode standard. Ali-K fonts: *Alwand, Azzam, Hasan, Jiddah, kanaqen, Khalid, Sahifa, Sahifa Bold, Samik, Sayid, Sharif, Shrif Bold, Sulaimania, Traditional*\n```cs\nAsoSoft.AliK2Unicode(\"ئاشناكردنى خويَندكار بة طوَرِانكاريية كوَمةلاَيةتييةكان\");\n\u003eئاشناکردنی خوێندکار بە گۆڕانکارییە کۆمەڵایەتییەکان\u003c\n```\n\n### AliWeb to Unicode\n`AliWeb2Unicode` converts Kurdish text written in AliK fonts into Unicode standard. Ali-Web fonts: *Malper, Malper Bold, Samik, Traditional, Traditional Bold*\n```cs\nAsoSoft.AliWeb2Unicode(\"هةر جةرةيانصکي مصذووُيي کة أوو دةدا\");\n\u003eھەر جەرەیانێکی مێژوویی کە ڕوو دەدا\u003c\n```\n\n### Dylan to Unicode\n`Dylan2Unicode` converts Kurdish text written in Dylan fonts (developed by Dylan Saleh at [KurdSoft](  https://web.archive.org/web/20020528231610/http://www.kurdsoft.com/) in 2001) into Unicode standard.\n```cs\nAsoSoft.Dylan2Unicode(\"لثكؤلثنةران بؤيان دةركةوتووة كة دةتوانث بؤ لةش بةكةصك بث\");\n\u003eلێکۆلێنەران بۆیان دەرکەوتووە کە دەتوانێ بۆ لەش بەکەڵک بێ\u003c\n```\n### Zarnegar to Unicode\n`Zarnegar2Unicode` converts Kurdish text written in Zarnegar word processor (developed by [SinaSoft](http://www.sinasoft.com/fa/zarnegar.html) with RDF converter by [NoorSoft](https://www.noorsoft.org/fa/software/view/6561)) and into Unicode standard.\n```cs\nAsoSoft.Zarnegar2Unicode(\"بلٌيٌين و بگه‏رٍيٌين بوٌ هه‏لاٌلٌه‏ى سىٌيه‏مى فه‏لسه‏فه‏\");\n\u003eبڵێین و بگەڕێین بۆ هەڵاڵەی سێیەمی فەلسەفە\u003c\n```\n### NormalizePunctuations\n`NormalizePunctuations` corrects spaces before and after of the punctuations. When `seprateAllPunctuations` is true, \n```cs\nAsoSoft.NormalizePunctuations(\"دەقی«کوردی » و ڕێنووس ،((خاڵبەندی )) چۆنە ؟\", false);\n\u003eدەقی «کوردی» و ڕێنووس، «خاڵبەندی» چۆنە؟\u003c\n```\n### Trim Line\nTrim starting and ending white spaces (including zero width spaces) of line,\n`TrimLine`\n```cs\nAsoSoft.TrimLine(\"   دەق\\u200c  \");\n\u003eدەق\u003c\n```\n\n### Replace Html Entities\n`ReplaceHtmlEntity` replaces HTML Entities with single Unicode characters (e.g. \"\u0026eacute;\" with \"é\"). It is useful in web crawled corpora.\n```cs\nAsoSoft.ReplaceHtmlEntity(\"ئێوە \u0026quot;دەق\u0026quot; لە زمانی \u0026lt;کوردی\u0026gt; دەنووسن\");\n\u003eئێوە \"دەق\" بە زمانی \u003cکوردی\u003e دەنووسن\u003c\n```\n### Replace URLs and emails\n`ReplaceUrlEmail` replaces URLs and emails with a certain word. It improves language models.\n\n### Unify Numerals\n`UnifyNumerals` unifies numeral characters into desired numeral type from `en` (0123456789) or `ar` (٠١٢٣٤٥٦٧٨٩)\n```cs\nAsoSoft.UnifyNumerals(\"ژمارەکانی ٤٥٦ و ۴۵۶ و 456\", \"en\");\n\u003eژمارەکانی 456 و 456 و 456\u003c\n```\n\n### Seperate Digits from words\n`SeperateDigits` add a space between joined numerals and words (e.g. replacing \"12کەس\" with \"12 کەس\"). It improves language models.\n```cs\nAsoSoft.SeperateDigits(\"لە ساڵی1950دا1000دۆلاریان بە 5کەس دا\");\n\u003eلە ساڵی 1950 دا 1000 دۆلاریان بە 5 کەس دا\u003c\n```\n\n### Word to Word Replacment\n`Word2WordReplacement` applies a \"string to string\" replacement dictionary on the text. It replaces the full-matched words not a part of them.\n```cs\nvar dict = new Dictionary\u003cstring, string\u003e() { { \"مال\", \"ماڵ\" } };\nAsoSoft.Word2WordReplacement(\"مال، نووری مالیکی\", dict);\n\u003eماڵ، نووری مالیکی\u003c\n```\n\n### Character to Character Replacment\n`Char2CharReplacment` applies a \"char to char\" replacement dictionary on the text. It uses as the final step needed for some non-Unicode systems.\n\n## Kurdish Numeral converter\nIt converts numerals into Central Kurdish words. It is useful in text-to-speech tools.\n- integers (1100 =\u003e )\n- floats (10.11)\n- negatives (-10.11)\n- percent (100% or %100)\n- querency marks ($100, £100, and €100)\n\n```cs\nAsoSoft.Number2Word(\"لە ساڵی 1999دا بڕی 40% لە پارەکەیان واتە $102.1 یان وەرگرت\");\n\u003eلە ساڵی هەزار و نۆسەد و نەوەد و نۆدا بڕی چل لە سەد لە پارەکەیان واتە سەد و دوو پۆینت یەک دۆلاریان وەرگرت\u003c\n```\n\n## Kurdish Sort\nSorting a string list in correct order of Kurdish alphabet (\"ئءاآأإبپتثجچحخدڎذرڕزژسشصضطظعغفڤقكکگلڵمنوۆۊۉهھەیێ\")\n```cs\nvar myList = new List\u003cstring\u003e{\"یەک\", \"ڕەنگ\", \"ئەو\", \"ئاو\", \"ڤەژین\", \"فڵان\"}\nAsoSoft.KurdishSort(myList);\n\u003e\"ئاو\", \"ئەو\", \"ڕەنگ\", \"فڵان\", \"ڤەژین\", \"یەک\"\u003c\n```\nor using your custom order:\n```cs\nAsoSoft.CustomSort(List\u003cstring\u003e inputList, List\u003cchar\u003e inputOrder);\n```\n## Poem Meter Classifier\nIt classifies the meter of the input Kurdish poem typed in Arabic script. The lines of the poem should be seprated by new line char ('\\n').\nYou can find Kurdish poems in https://books.vejin.net/.\n```cs\nvar poem = AsoSoft.PoemNormalization(@\"گەرچی تووشی ڕەنجەڕۆیی و حەسرەت و دەردم ئەمن\nقەت لەدەس ئەم چەرخە سپڵە نابەزم مەردم ئەمن\nئاشقی چاوی کەژاڵ و گەردنی پڕ خاڵ نیم\nئاشقی کێو و تەلان و بەندەن و بەردم ئەمن\");\nvar syllabified = AsoSoft.G2P(poem, true, true, true).Split('\\n');\nvar classified = AsoSoft.PoemClassification(syllabified);\nvar poemType = classified.overalMeterType;\nvar poemMeter = classified.overalPattern;\n```\n\n## How to use?\nInstall [AsoSoft Library package](https://www.nuget.org/packages/AsoSoftLibrary) via NuGet Gallery.\nThen, insert `using AsoSoftLibrary;` into \"Usings\" of your codes.\n\n## Development\nAsoSoft Library is developed and maintained by Aso Mahmudi.\nAsoSoft Library is written in C# (.NET 6).\n","funding_links":[],"categories":["Development"],"sub_categories":["Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAsoSoft%2FAsoSoft-Library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAsoSoft%2FAsoSoft-Library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAsoSoft%2FAsoSoft-Library/lists"}