carakan.js
JS library for converting Latin script into Javanese script (Aksara Jawa/Carakan)
September 2020Node.jsLibrary
carakan.js
carakan.js is a small JavaScript library for converting Latin script into Javanese script, also known as Aksara Jawa/Carakan. Converting to Latin script is planned for future releases.
Why this library?
I know there are already many Javanese script transliterating library out there. But they are not accurate. At least for some words with complicated syllable structure due to the nature of Javanese language. Like "ngglembyar", "nggrambyang".
It is caused by the complexity of Javanese script writing rules. Therefore I want to create a library to create a more accurate transliteration from Latin into Javanese script and vice versa with the linguistic complexity and ease of use in mind.
Usage
Normal Usage
import { toCarakan } from "carakanjs";
// Example input with default options
const example = toCarakan(
"aku ambyar",
{ diacritics: false, swaraMurda: true }
);
// prints ꦲꦏꦸꦲꦩ꧀ꦧꦾꦂ
Writing pepet and taling (/ə/ and /e/ sound)
const esDawet1 = toCarakan("es dawxt"); // prints ꦲꦺꦱ꧀ꦢꦮꦼꦠ꧀
const gembeng1 = toCarakan("gxmbeng"); // prints ꦒꦼꦩ꧀ꦧꦺꦁ
// "Diacritics" mode, false by default. You can use grave accent or accented 'e'.
// Here it is escaped...
const esDawet2 = toCarakan("e\`s dawet", {diacritics: true}); // prints ꦲꦺꦱ꧀ꦢꦮꦼꦠ꧀
const gembeng2 = toCarakan("gembe\`ng", {diacritics: true}); // prints ꦒꦼꦩ꧀ꦧꦺꦁ
// Another example. Useful when copy-pasting from Wikipedia Basa Jawa
const esDawet3 = toCarakan("és dawet", {diacritics: true}); // ꦲꦺꦱ꧀ꦢꦮꦼꦠ꧀
const gembeng3 = toCarakan("gembéng", {diacritics: true}); // ꦒꦼꦩ꧀ꦧꦺꦁ
Writing aksara Murda and Swara
Remember that aksara Murda only contains na, ka, ta, sa, pa, nya, ga, and ba. Any other consonants that's written with an uppercase letter will likely return a malformed output.
// true by default
const example1 = toCarakan("GuSTi Allah"); // ꦓꦸꦯ꧀ꦡꦶꦄꦭ꧀ꦭꦃ
const example2 = toCarakan("Banjar"); // ꦨꦤ꧀ꦗꦂ
const example3 = toCarakan("Banjar", {swaraMurda: false}); // ꦧꦤ꧀ꦗꦂ
Pada lingsa (comma) will not render if a pangkon is next to it. And pada lungsi (period) will become pada lingsa if a pangkon is next to it. This behavior is expected and actually adheres to the rules of Javanese writing.