An open API service indexing awesome lists of open source software.

https://github.com/wtetsu/deinja

🌸De-inflect Japanese words
https://github.com/wtetsu/deinja

Last synced: 7 months ago
JSON representation

🌸De-inflect Japanese words

Awesome Lists containing this project

README

          


logo

Build Status
Code Climate
codecov
npm version

# deinja

**deinja** is a lightweight JavaScript library that converts inflected Japanese words into their original forms.

Instead of aiming for perfect accuracy, *deinja* prioritizes speed and simplicity. It does **not** include internal dictionary data, which means it may return **multiple possible candidates** for each input rather than a single definitive answer.

This library was originally a component of [Mouse Dictionary](https://github.com/wtetsu/mouse-dictionary), and has since been extracted into a standalone module.

## Installation

```
npm i deinja
```

## Usage

```js
import deinja from "deinja";

deinja.convert("素早く"); // ["素早い"]
deinja.convert("θ»’γŒγ—"); // ["θ»’γŒγ™"]
deinja.convert("ζŠ•γ’γŸ"); // ["ζŠ•γ’γ‚‹", "ζŠ•γ"]

deinja.convert("ζ­»γ«γΎγ—γŸ"); // ["死ぬ"]
deinja.convert("硂わって"); // ["硂わう", "硂わ぀", "硂わる"]
deinja.convert("γ—γΎγ£γŸ"); // ["しまう", "しま぀", "しまる"]
```

## License

Apache 2.0

## Acknowledgments

deinja is built upon deinflector, a Java-based tool for Japanese word normalization.

https://github.com/Jimeux/deinflector