npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

akarata

v0.2.1

Published

Pustaka Javascript untuk memisahkan kata dari imbuhan awal ataupun akhir pada bahasa Indonesia

Downloads

122

Readme

Akarata

Build Status codecov npm

README Bahasa version

Akarata is a JavaScript library to retrieve the root / syllable root (stem) from word stem that does have a prefix in front of the word or suffix at the end of the word in Indonesian. Akarata is derived from the word "akar kata" in indonesian, for easier pronouncing.

Akarata inspired by stem of word in Indonesian based on Porter Stemmer, using algorithm published in paper A Study of Stemming Effects on Information Retrieval in Bahasa Indonesia, by Fadillah Z Tala.

Akarata created universally, can be run on the server using Node.js or in the modern browser even inreact-native. But it should be noted that the compatibility of the platform. Check on Compatibility function

Requirement

tslib >= 1.9.0

Installation

npm:

npm install --save tslib akarata

yarn:

yarn add tslib akarata

Compatibility function

Because akarata uses Array.includes. So if you use akarata on Node.js version 4, browser Edge < v14, IE, Chrome < v47, Firefox < 43, Safari < v9, etc(see table) you need polyfill. You can jump to this section to include it Include polyfill

Include polyfill

Skip this step if platform is supported.

use npm:

npm i ts-polyfill

use yarn:

yarn add ts-polyfill

Usage polyfill

Import this before you import akarata, usually put it on top.

on node.js:

require('ts-polyfill/lib/es2016-array-include');

on ES2015+ / Babel / TypeScript:

import 'ts-polyfill/lib/es2016-array-include';

Only use script tag:

If you do not want to install ts-polyfill. Then copy the code in the documentation polyfill

<script type="javascript">
  // paste code here
<script>

Usage

Importing the library

ES2015+ / Babel / TypeScript:

// import library
import * as akarata from 'akarata';
// or
import akarata from 'akarata';

CommonJS/ UMD / NodeJS:

// import library
var akarata = require('akarata');

Michael Jackson script/ MJS / NodeJS experimental-modules:

// import library
import * as akarata from 'akarata';
// or
import akarata from 'akarata';

unpkg.com:

// since akarata version > 0.1.5
// unpkg.com/:package@:version/:file
// `.min` means compressed version
// for instance
import * as akarata from 'https://unpkg.com/[email protected]/bundles/index.esm.js';
// or
import akarata from 'https://unpkg.com/[email protected]/bundles/index.esm.min.js';

// or with absolute url, fallback to bundles/index.umd.js
import akarata from 'https://unpkg.com/akarata';

Then you can use it

// call the stem method
akarata.stem('menikah'); // nikah

Or you can directly try it on this web: akarata.netlify.com.

Issues

By cause of this module is still in its development process, submit a ticket if you are facing an issue.

Contributing

This module is intended to be a Javascript implementation of Apache Lucene's Bahasa Indonesia word stemmer.

  1. Require Node.js version >= 8.5
  2. Fork this project
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Make changes and test cases for your feature in __tests__ directory and run npm test
  5. Save your changes and add them (git add .)
  6. Commit your changes (git commit -m 'Added some new feature')
  7. Push to the branch (git push origin my-new-feature)
  8. Create new pull request

Reference

  1. Great Dictionary of the Indonesian Language
  2. To look up and verify Indonesian words
  3. Wikipedia article (in Bahasa) Prefixes in Bahasa Indonesia

Thanks

First and foremost, I would like to thank to Allah Subhanahu Wa Ta'ala, that without his blessings this project could not be made. I would like to also thank:

  • Faidlah Z Tala & Apache Lucene as without them this module could not be made
  • Kateglo Bahtera for providing an API so this module could separate ambiguous words and validation.
  • Adinda Praditya & Indonesian Stemmer for the great mentorship along with his project, this module could be implemented in JavaScript