A Go Lang package for dealing with Arabic text.
A Go Lang package for dealing with Arabic text.
This is an initial work on a set of Go functions developed to enhance Arabic web applications. It all started when I wanted to develop a self-hosted no-dependency and standalone Arabic Captcha in Go (for fun, as I was discovering Go ~8 yrs ago), and as expected, the Arabic text wasn't rendered as it should:
So I started playing with Glyphs, unicode, and the special Arabic rules for joining letters. After a bit of work, I got this:
shouldn't this be a separated package, along with other functionalities? I guess it should!
go get github.com/01walid/goarabic
package main
import (
"fmt"
"github.com/01walid/goarabic"
)
func main() {
fmt.Println(goarabic.RemoveTashkeel("نًصٌ عَربيُّ"))
fmt.Println(goarabic.ToGlyph("تجربة النص العربي"))
}
Package docs available on gopkgdoc.
Contributions are greatly appreciated. Please fork this repository, make your changes, and open a pull request. More test cases and considerations might be needed, you can run tests using go test
for the existing functionalities.
This a SemVersioned package.
MIT License.