# @tomsd/morphoanalyzer

It is a morphological analyzer for Japanese with kuromoji.

![npm](https://img.shields.io/npm/v/@tomsd/morphoanalyzer?style=for-the-badge&logo=npm)
![NPM](https://img.shields.io/npm/l/@tomsd/morphoanalyzer?style=for-the-badge&logo=npm)

![ci](https://img.shields.io/github/actions/workflow/status/tomsdoo/morphoanalyzer/ci.yml?style=social&logo=github)
![checks](https://img.shields.io/github/check-runs/tomsdoo/morphoanalyzer/main?style=social&logo=github)
![top language](https://img.shields.io/github/languages/top/tomsdoo/morphoanalyzer?style=social&logo=typescript)
![depends on node greater or equal 20](https://img.shields.io/badge/node.js-%3E%3D%2020-lightyellow?style=social&logo=nodedotjs)


## Installation
``` sh
npm install @tomsd/morphoanalyzer
```

# Usage

``` typescript
import { Analyzer } from "@tomsd/morphoanalyzer";

Analyzer.analyze("これは、テストです。")
  .then(console.log);

/*
[
  { surface: 'これ', pos: '名詞' },
  { surface: 'は', pos: '助詞' },
  { surface: '、', pos: '記号' },
  { surface: 'テスト', pos: '名詞' },
  { surface: 'です', pos: '助動詞' },
  { surface: '。', pos: '記号' }
]
*/

// and you can feel free to pass your dict directory, too
Analyzer
  .analyze(
    "これは、テストです。",
    "path/to/dict"
  )
  .then(console.log);

```
