Carakan.js

📆 Posted on 12 Nov 2020
Tags:  Node.jsLibrary
Date
Nov 12, 2020
Tags
Node.js
Library
notion image

Carakan.js

Carakan.js is a small library for converting/transliterating Latin script into Javanese script, also known as Aksara Jawa or Carakan. Check it out here:

👀 Why this library?

Yes, 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".
The complexity of Javanese script writing rules made things difficult. 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, so we can just input the regular Javanese text we usually read and write in Latin text in our everyday conversations.
Carakan.js is also fast, needing only less than 2 milliseconds to convert a simple sentence. The library is also extensively tested using various sentences and use cases. You can see the tests here.

🚀 Features

Currently, Carakan.js can handle:
  • Basic Hanacaraka (20 basic characters) and its Pasangan
  • Sandhangan Swara (wulu, taling, pepet, suku, taling tarung)
  • Sandhangan Wyanjana (cakra, wignyan, etc) and Panjingan
  • Angka
  • Aksara Swara
  • Aksara Rekan
  • Aksara Murda
  • Aksara Ganten
  • Pada (Punctuations)
  • Supports accents (like Wikipedia Basa Jawa)
  • ...and many more (see the code yourself!)

📦 Installation

NPM
npm install carakanjs
Yarn
yarn add carakanjs

⌨️ Usage

Example with default options
import { toJavanese } from "carakanjs"; let x = toJavanese("blumbang gxmblundhung kxmambang"); // with default configs (optional) let x = toJavanese("blumbang gxmblundhung kxmambang", {useAccents: false, useSwara: true, useMurda: true}) console.log(x) // => ꦧ꧀ꦭꦸꦩ꧀ꦧꦁꦒꦼꦩ꧀ꦧ꧀ꦭꦸꦤ꧀ꦝꦸꦁꦏꦼꦩꦩ꧀ꦧꦁ
Writing Pepet and Taling sounds (with default config)
// pepet is "x" // taling is "e" toJavanese("es dawxt"); // => ꦲꦺꦱ꧀ꦢꦮꦼꦠ꧀
Writing Pepet and Taling sounds (with useAccents = true)
// pepet is "e" // taling is "é", "è", or "e`" (e + backtick) toJavanese("e`s dawet", {useAccents: true}); // or toJavanese("és dawet", {useAccents: true}); // => ꦲꦺꦱ꧀ꦢꦮꦼꦠ꧀ // example text from Wikipedia basa Jawa toJavanese( "référèndhum menika mutusaken Timor Wétan pisah", {useAccents: true} ); // => ꦫꦺꦥ꦳ꦺꦫꦺꦤ꧀ꦝꦸꦩ꧀ꦩꦼꦤꦶꦏꦩꦸꦠꦸꦱꦏꦼꦤ꧀ꦡꦶꦩꦺꦴꦂꦮꦺꦠꦤ꧀ꦥꦶꦱꦃ
Writing Aksara Swara, Murda, and Rekan
toJavanese("GUSTI ALLAH YA KHALIK"); // => ꦓꦸꦯ꧀ꦡꦶꦄꦭ꧀ꦭꦃꦪꦏ꦳ꦭꦶꦑ꧀
Writing Angka (Numbers)
// pada pangkat (꧇) will be automatically added around numbers toJavanese("tanggal 17 bulan 8 taun 1945"); // => ꦠꦁꦒꦭ꧀꧇꧑꧗꧇ꦧꦸꦭꦤ꧀꧇꧘꧇ꦠꦲꦸꦤ꧀꧇꧑꧙꧔꧕꧇
Writing Pada (Punctuations)
toJavanese("{<||,:.'\":()>}"); // => ꧁꧌꧋꧋꧈꧇꧉꧊꧊꧇꧊꧊꧍꧂
Writing Aksara Ganten & Panjingan
toJavanese("kreta krxtxg, lxmah rxgxd"); // => ꦏꦿꦺꦠꦏꦽꦠꦼꦒ꧀‌ꦊꦩꦃꦉꦒꦼꦢ꧀

⁉️ Table of Punctuations

Name
Input
Output
Pada lingsa *
Pada lungsi *
.
Pada pangkat
:
Pada adeg
" or ' or ( or )
Pada adeg-adeg
|
Pada piseleh
<
꧌ ......
Pada piseleh walik
>
...... ꧍
Rerengan kiwa
{
꧁ ...
Rerengan tengen
}
... ꧂

⚠️
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.

📖 References

©
Nourman
Hajar
NOURMAN·COM·NOURMAN·COM·