Skip to content

A JS library for text translation between Unicode, Legacy fonts and Singlish

Notifications You must be signed in to change notification settings

Open-SL/sinhala-unicode-converter

Repository files navigation

Special Thansk to UCSC

Original translation code was developed by Language Technology Research Laboratory - University of Colombo School of Computing. (2011)
Source: https://ucsc.cmb.ac.lk//ltrl/services/feconverter/

Installation

Repository: https://www.npmjs.com/package/sinhala-unicode-coverter

Using npm:

npm i --save sinhala-unicode-coverter

Using yarn:

yarn add sinhala-unicode-coverter

API

There are 12 methods exported from the package. Each of them takes an string as a input and returns the converted string.

Legacy format to Unicode

Method Description
dlManelToUnicode DL-Manel to Unicode
baminiToUnicode Bamini to Unicode
kaputaToUnicode Kaputa to Unicode
fmAbayaToUnicode FM-Abaya to Unicode
amaleeToUnicode Amalee to Unicode
thibusToUnicode Thibus to Unicode

Unicode to Legacy

Method Description
unicodeToDlManel Unicode to DL-Manel
unicodeToBamini Unicode to Bamini
unicodeToKaputa Unicode to Kaputa

Unfortunately we don't have unicode to legacy functionality for FM-Abaya, Amalee, Thibus.

Singlish to Unicode

Method Description
singlishToUnicode Singlish (Sinhala) to Unicode
singlishPhoneticToUnicode Singlish Phonetic (Sinhala) to Unicode

Tanglish to Unicode

Method Description
tanglishToUnicode Tanglish (Tamil) to Unicode

Example Usage

// Legacy to unicode
import { dlManelToUnicode, singlishToUnicode, unicodeToDlManel } from "sinhala-unicode-coverter"
const a = dlManelToUnicode("Y%S ,xld")
console.log(a) // ශ්‍රී ලංකා 

// Unicode to DL-Manel
const b = unicodeToDlManel("ශ්‍රී ලංකා")
console.log(b) // Y%S ,xld


// Singlish to Unicode
const c = singlishToUnicode("shrii la\\nkaa")
console.log(c) // ශ්‍රී ලංකා 

About

A JS library for text translation between Unicode, Legacy fonts and Singlish

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published