First tagged release of garabic — a set of functions for Arabic text processing in Go.
مكتبة برمجية توفر دوالاً للتعامل مع النصوص العربية في لغة برمجة go
Install
go get github.com/abdullahdiaa/garabic@v0.1.0
Highlights
- Normalization —
Normalize,RemoveHarakatfor search- and index-friendly Arabic text. - Glyph shaping —
Shapeconnects and reorders Arabic and Persian letters (پ چ ژ گ) for rendering on images and other non-RTL-aware surfaces. - Justification —
Justifystretches Arabic lines with kashida (tatweel) to an exact rune width. - Numbers —
SpellNumber(numbers to Arabic words), plusToArabicDigits/ToPersianDigits/ToEnglishDigits. - Diacritics —
Tashkeeladds matching diacritics (initial support). - Helpers —
IsArabic,IsArabicLetter.
Notable fixes in this release
Shapeno longer misplaces diacritics on words combining tashkeel with a lam-alef ligature (لا / لأ / لإ / لآ).Tashkeelno longer panics on sentences ending with a preposition.Justifyno longer panics on edge-case inputs; width math is rune-exact.ToPersianDigitsemits proper Persian codepoints (۰–۹) for all ten digits.
Full details in the CHANGELOG.
Requires Go 1.25+. Tested with race detector at 96% coverage.