Sunda.js is a small library for converting/transliterating Latin into Sundanese script (Aksara Sunda Baku), or vice versa.
Sunda.js is based off of my other project, Carakan.js, which is a transliterator library for Javanese script. After researching about the Sundanese script, I found that the Sundanese writing system is similar, and even a lot simpler than the Javanese one. Then, I realized that the same algorithm could be used to transliterate Latin into it. As I see that there's no library for transliterating Latin into Sundanese script yet (and vice versa), I decided to make one.
Sunda.js is also fast. It just needs around 2 milliseconds to convert a simple sentence.
Currently, Sunda.js can handle these features:
- Aksara NgalagĂŠna
- Aksara NgalagĂŠna for foreign sounds (f, q, v, x, z, kh, sy)
- Aksara Swara
- All rarangkĂŠn
- Angka
- ...and many more (see the code yourself!)
NPM:
$ npm install sunda.js
Yarn:
$ yarn add sunda.js
Basic example
import { toSundanese } from "sunda.js";
let x = toSundanese("Wih, geulis euy!");
console.log(x)
// => áŽáŽ¤áŽ, áŽáŽŠáŽáŽ¤áŽáŽŞ áŽáŽáŽŞ!
Writing basic vowels
let x = toSundanese("pa pi pu pe pĂŠ peu po p");
console.log(x)
// => ᎠáŽáŽ¤ áŽáŽĽ áŽáŽ¨ áŽáŽŚ áŽáŽŠ áŽáŽ§ áŽáŽŞ
Writing various RerangkĂŠn
let x = toSundanese("Di KlatĂŠn, ada santri kyai tebang pohon buah pir");
console.log(x)
// => áŽáŽ¤ áŽáŽŁáŽáŽŚáŽáŽŞ, áŽáŽ áŽáŽáŽŞáŽáŽ˘áŽ¤ áŽáŽĄáŽ áŽáŽ¨áŽáŽ áŽáŽ§áŽ ᎧáŽáŽŞ áŽáŽĽáŽáŽ áŽáŽ¤áŽ
Writing numbers
// pipe (|) will be automatically added around numbers
let x = toSundanese("tanggal 17 bulan 8 taun 1945");
console.log(x)
// => áŽáŽáŽáŽáŽŞ |ᎹᎡ| áŽáŽĽáŽáŽáŽŞ |Ꮈ| áŽáŽ
áŽáŽŞ |Ꮉ᎚ᎴᎾ|
Basic example
import { toLatin } from "sunda.js";
let x = toLatin("áŽáŽ¤áŽ, áŽáŽŠáŽáŽ¤áŽáŽŞ áŽáŽáŽŞ!");
console.log(x)
// => wih, geulis euy!
Detecting rerangkĂŠn when converting back to Latin
let x = toLatin("áŽáŽ¤ áŽáŽŁáŽáŽŚáŽáŽŞ, áŽáŽ áŽáŽáŽŞáŽáŽ˘áŽ¤ áŽáŽĄáŽ áŽáŽ¨áŽáŽ áŽáŽ§áŽ ᎧáŽáŽŞ áŽáŽĽáŽáŽ áŽáŽ¤áŽ");
console.log(x)
// => di klatĂŠn, ada santri kyai tebang pohon buah pir
Writing numbers
// pipe (|) will be automatically removed from around numbers
let x = toLatin("áŽáŽáŽáŽáŽŞ |ᎹᎡ| áŽáŽĽáŽáŽáŽŞ |Ꮈ| áŽáŽ
áŽáŽŞ |Ꮉ᎚ᎴᎾ|");
console.log(x)
// => tanggal 17 bulan 8 taun 1945
- In Latin -> Sundanese transliteration, you can use either uppercase (capital) or lowercase. The result will be the same.
- In Sundanese -> Latin transliteration, pipe (|) immediately before and after numbers will be removed.
- Other than pipe (|), all characters that's not Sundanese or Latin character (like dot, comma, semicolon, etc) will be output as it is.
Sunda.js package exports four things: functions toSundanese()
& toLatin()
, and also namespace SundaHelper
and LatinHelper
which contains various helper.
Returns a string of transliterated Sundanese script, given Latin input.
Type: string
A string of Latin character which will be transliterated into Sundanese script. For examples, see the above section.
Returns a string of transliterated Latin script, given Sundanese script input.
Type: string
A string of Sundanese character which will be transliterated into Latin script. For examples, see the above section.
A namespace which contains various helper for the engine to convert Latin letters into Sundanese Script.
A namespace which contains various helper for the engine to convert Sundanese letters into Latin Script.
- support transliteration of Sundanese script back to Latin
- support more punctuations from ancient Sundanese character (Bindu Surya, Bindu Panglong, etc)