PackageTrack
Sign in Get early access

khaled.alshamaa/ar-php

Set of functionalities enable Arabic website developers to serve professional search, present and process Arabic content in PHP

v7.0.0 3.1M downloads/mo #1860 most downloaded on Packagist khaled-alshamaa/ar-php

What this package is like to depend on

Last release 1 years ago

07 Mar 2025

Release timing varies

gaps range from 3 weeks to 1.9 years

Nearly every release is documented

notes for 12 of 13 stable releases

Nothing withdrawn

no release was ever pulled

7 years old

13 releases · first in 2020

0 releases in the last 12 months

see the full history below

Release timeline

13 releases · Feb 2020 to Mar 2025
2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 13
  1. v7.0.0 07 Mar 2025
    Release notes
    • Full integration with the open-source version of the Arabic Spell Checker (ASC https://arabicspellchecker.com/open-source.html).

    • Implement a lazy-loading mechanism that defers reading large data files until they are actually needed, improving average performance by 40% ± 5%.

    • Add the new "arDialect" method for Arabic dialect identification (i.e., Egyptian, Levantine, Maghrebi, and Peninsular) of the text (e.g., comments, reviews, etc.).

    • Add an Arabic version of the PHP similar_text() function, implemented using the Needleman-Wunsch algorithm with weighted scoring matrices and a non-linear gap penalty.

    • Add Urdu characters support to the utf8Glyphs() function.

    • Expand character glyphs support in the utf8Glyphs() function to include all single letter variants listed in the Arabic Presentation Forms-A needed for Ottoman, Persian, Urdu, Sindhi, and Central Asian languages.

    • Various minor fixes and improvements, see related pull requests and closed issues for details.

    Open source →
    Release notes
    • Full integration with the open-source version of the Arabic Spell Checker (ASC https://arabicspellchecker.com/open-source.html).

    • Implement a lazy-loading mechanism that defers reading large data files until they are actually needed, improving average performance by 40% ± 5%.

    • Add the new "arDialect" method for Arabic dialect identification (i.e., Egyptian, Levantine, Maghrebi, and Peninsular) of the text (e.g., comments, reviews, etc.).

    • Add an Arabic version of the PHP similar_text() function, implemented using the Needleman-Wunsch algorithm with weighted scoring matrices and a non-linear gap penalty.

    • Add Urdu characters support to the utf8Glyphs() function.

    • Expand character glyphs support in the utf8Glyphs() function to include all single letter variants listed in the Arabic Presentation Forms-A needed for Ottoman, Persian, Urdu, Sindhi, and Central Asian languages.

    • Various minor fixes and improvements, see related pull requests and closed issues for details.

    Top

    Open source →
  2. v6.3.4 04 Apr 2023
    Release notes Open source →
    Release notes

    Top

    Open source →
  3. v6.3.3 31 Mar 2023
    Release notes Open source →
    Release notes

    Top

    Open source →
  4. v6.3.2 21 Jan 2023
    Release notes Open source →
    Release notes

    Top

    Open source →
  5. v6.3.1 18 Dec 2022
    Release notes Open source →
    Release notes
    • Add new functionality to normalize digits styles in the arNormalizeText() function by setting the symbol's type used to represent numerical digits (Arabic, Hindu, or Persian). Thanks to Taha Zerrouki for his suggestion.

    • Add the new diffForHumans method to get the difference between 2 timestamps in a human-readable format. Thanks to Watheq Alshowaiter for requesting this functionality.

    • Improve example scripts by adding anchor links to the internal sections and links to the related reference documentation.

    • Fix the issue of the masculine names formed by adding special feminine characters to the end (e.g., علاء, أسامة, زكريا, مصطفى). Thanks to Alaa Najmi for reporting this.

    • Fix the issue of handling HARAKAT before SHADDA properly, including the overlapping SHADDA with HARAKAT. Thanks to Said Bakr for reporting #33 and contributing to fixing it.

    • Fix the issue of singular feminine numbers. Thanks to Jeremy Varnham and Saudi ADHD Society for the fix.

    • Fix the bug #34 of the undefined array key when the string starts by LAM-ALEF in the arGlyphs() function. Thanks to Tarun Saini for the fix.

    • Fix the bug #47 of handling Arabic-Indic digits in the arGlyphs() function. Thanks to Mohammed Anas Al-Mahdi for reporting it.

    • Make sure that the required calendar extension is enabled. Thanks to Marwane Chaoui for the fix.

    Top

    Open source →
  6. v6.3.0 17 Jun 2022
    Release notes Open source →
    Release notes
    • Add Arabic text normalization method (e.g., Alef, Hamza, Taa, Alef Lam, etc.). Thanks to Watheq Alshowaiter for the request.

    • Rewrite the Arabic glyphs mechanism for more flexibility and performance, and resolve reported issue #25 with some fonts like Cairo and Tajawal by using standard UTF-8 code for isolated letters instead of the Arabic Presentation Forms-B. Thanks to Firas Darwish for reporting this issue and Khaled Hosny for help in fixing it.

    • Fix issues of handling glyphs of LAM-ALEF and SHADDA with HARAKAT properly. Thanks to Said Bakr for reporting these issues and Khaled Hosny for help in fixing it.

    • Improve the arIdentify method by adding an option to ignore the HTML tags (active by default).

    • Improve the way that the keyboard swap function handles لا case (i.e., b vs. gh option) using a probability model.

    • Improve sentiment analysis model by optimise system parameters and calculate probability method.

    • Improve the code performance by replacing str_replace function with strtr function (arSummary can handle 145% of requests per second compared to the previous version).

    • Account for the spelling difference of using Yaa' instead of Hamza Ala Nabrah in the arQueryAllForms() and arQueryWhereCondition() methods. Thanks to Hamad Adhbiyah for mentioning it in this issue.

    • Fix the issue of Hijri date correction not behaving consistently when the Hijri month end on 29th. Thanks to Socotoly for the fix.

    • Fix the internal method to clean common words by making sure to remove the whole words only.

    • Fix PHP notices in handling some extreme cases in glyphs algorithm. Thanks to Denis Chenu from LimeSurvey team.

    • Fix the range of Arabic chars in the UTF-8 table and define it properly to include all extended Arabic chars. Thanks to sakai ryota for mentioning it in this issue.

    • Fix minor issues in the utf8Glyphs method when handling Arabic and non Arabic chars in the same line which reported by sakai ryota.

    • Improve the code quality by fix all issues reported by the PHPStan.org (PHP Static Analysis Tool) up to the rule level 6.

    • Use version 0.114 of the Amiri font (changes in this release).

    Top

    Open source →
  7. v6.2.0 20 Jun 2021
    Release notes
    • Improve the usability of the arSentiment method by changing the returned value to be an array of two elements: isPositive (boolean, positive if true and negative if false), and probability (float, ranged from 0 to 1). Thanks to Zaid Alyafeai and fruitful brainstorming with ARBML team.

    • Improve the arSentiment method by adding a simple rule-based mechanism to handle the case of having negation words. Thanks to Zaid Alyafeai and fruitful brainstorming with ARBML team.

    • Add noDots method to get Arabic text written using letters without dots and Hamzat including Progressive Web App (PWA) example.

    • Add basic support to transliterate Arabizi (Franco-Arabic) into Arabic text in the en2ar method.

    • Improve the stripHarakat method by make it able to remove the last Harakat alone. Thanks to Tameem Ahmad for his suggestion.

    • Remove extra space after the WAW letter (and) when spelling numbers in the Arabic idiom.

    • Optimize the big SVG files of country flags using the SVGO web app tool, which saved ~70 kb.

    • Add JavaScript version of the Arabic sentiment analysis model and query algorithm to the examples directory.

    • A few bug fixes in handling leading zeros in int2str, 1 and 2 in str2int, and midnight calculation in getPrayTime.

    Top

    Open source →
  8. v6.1.0 30 Apr 2021
    Release notes
    • Rewrite the utf8Glyphs method using arIdentify for better performance and bidi handling logic.

    • Improve slow methods performance including "arIdentify", "arSummaryRankSentences", "checkAr" and "checkEn". They are now faster as per Xdebug profiler (x10, x7, x4 and x4 respectively).

    • Fix the issue #5 that reported in the money2str method. Thanks to Ahmed Fawky.

    • Test the Arabic Glyphs algorithm against long text examples from Wikipedia and fix few small bugs that occur in some special cases (e.g., issue #6 of a string starts by Lam with Alef, Thanks to Ahmed Heik).

    • Improve examples by enhancing the associated description.

    Top

    Open source →
  9. v6.0.0 15 Feb 2021
    Release notes
    • Add the new "arSentiment" method for Arabic sentiment analysis to determine the tone (i.e., positive or negative) of the text (e.g., comments, reviews, etc.).

    • Fix the issue of extra space at the end of returned string in the "ar2en" and "en2ar" methods. Thanks to Hamoud Alhoqbani.

    • Fix the issue of ignoring the punctuation marks when coming in the Arabic text context for more robust segmentation using the "arIdentify" method. Thanks to Fahad Khan notification.

    • Add the new "arPlural" method to get proper plural form depends on the item count. Thanks to Arabeyes Wiki.

    • Improve the plural form of the currancy name in the "money2str" method.

    • Add the new "stripHarakat" method to clean given Arabic string from Harakat. You can include/exclude Tatweel, Tanwen, Shadda, and Last Harakat.

    • Adding support for 5 extra Persian letters (Peh), (Tcheh), (Jeh), (Gaf), and (Yeh) to the "utf8Glyphs" method. Thanks to Yossi Beck [email protected].

    • Add the new "addGlyphs" method to insert any new / not supported letter into the existing Glyphs rules.

    • Add methods "dd2olc", "olc2dd", and "volc" to encode, decode, and validate location coordinates (latitude and longitude in WGS84) in the Open Location Code format.

    • Review and simplify the isFemale method.

    • Use the Amiri font in the glyphs example. Thanks to Khaled Hosny.

    • Remove the tests of execution time and memory allocated in all examples for more robust benchmarking reporting using the Apache ab tool.

    Top

    Open source →
  10. v5.5.2 26 Jan 2021
    Release notes

    Top

    Open source →
  11. v5.5.1 18 Dec 2020
    Release notes
    • Profiling the library script using Xdebug, that helps in detect and resolve a bottleneck in the __construct method. It now takes only %25 of processing time on loading/initialize the library, and it is 15% faster comparing to the previous version.

    • Write unit tests in the tests/ArabicTest.php script that covers all examples functionalities using the PHPUnit framework.

    • Add class documentation in the docs folder using the phpDocumentor documentation application for PHP projects.

    • Improve the code quality by fix all errors reported in the PHPStan.org (PHP Static Analysis Tool) up to the rule level 5.

    • Pass the compatibility testing with the new version of PHP 8.0 (released on Nov 26, 2020) successfully.

    • Move demo scripts to the examples folder instead of the tests folder.

    Top

    Open source →
  12. v5.1.0 27 Jun 2020
    Release notes
    • Use JSON instead of XML for data files to improve the performance (this version can handle 175% of requests per seconds comparing to version 5.0.0).

    • Migrate the arIdentify method from version 4.0.0 to extract the Arabic text segments in a given UTF-8 multi language document.

    • Add "dd2dms" method to convert coordinates from decimal degrees to degrees, minutes, seconds format.

    • Handle the complement day of Hijri month in a proper way when $correction value is not 0. Thanks to Mohamed Abdallah [email protected].

    • Fix the "int2str" method bug in the output of ordering numbers for values 2-10, 20, 30, etc. Thanks to Said Bakr [email protected].

    • Fix the issue of replacing & by &; in the utf8Glyphs method. Thanks to Ramon Leenders https://github.com/ramonleenders.

    • Improve English soundex example using metaphone function as it knows the basic rules of English pronunciation (e.g. C of Clinton Pronounces K).

    Top

    Open source →
  13. v5.0 09 Feb 2020

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive