Skip to content

This repository includes sinhala to singlish converter library.

License

Notifications You must be signed in to change notification settings

wgarunap/singlish

Repository files navigation

Singlish

Convert Sinhala to Singlish in Golang

Singlish

Test MIT License GitHub Release

Overview

accuracy is not 100% guaranteed. Tested for main words and strings only.

Use Repository

go get -u github.com/wgarunap/singlish

Example

package main

import (
	"fmt"
	singlish "github.com/wgarunap/singlish"
)

func main() {
	txt:=singlish.TranslateString("මෙය url generate කිරීම උදෙසා ලියන ලද්දක් බැවින් නිරවද්‍යතාවය 100% තහවුරු කර නැත.")
	fmt.Println(txt) 
	//Output
	//meya url generate kiriima udhesa liyana ladhdhak bewin nirawadhyathawaya 100 thahawuru kara netha
	
	txt2:=singlish.TranslateSinhalaStr("මෙය සිංහල එකකි")
	fmt.Println(txt2)
	//Output
	//meya sinhala ekaki

	txt3:=singlish.TranslateString(`මෙය !"#$%&'()*+,-./:;<=>?@[\]^_{|}~ එකකි `)
	fmt.Println(txt3)
	// Output 
	//meya ekaki
}

Run Test

go test ./...

Benchmark

Run benchmarks

go test -bench=.

Benchmark Results

goos: darwin
goarch: amd64
pkg: github.com/wgarunap/singlish
cpu: Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
BenchmarkTranslate1Char-4        4068814               283.9 ns/op
BenchmarkTranslate4Char-4        1000000              1018 ns/op

Contributions

I am more than happy to receive contributions to this repository.

contact : wg.aruna.p@gmail.com