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

https://github.com/hota1024/mecab-client

MeCab client library written in TypeScript
https://github.com/hota1024/mecab-client

mecab morphological-analysis typescript

Last synced: 5 months ago
JSON representation

MeCab client library written in TypeScript

Awesome Lists containing this project

README

          

![mecab-client](https://user-images.githubusercontent.com/24543982/89710195-b959c000-d9bb-11ea-9c7b-8517d2af1406.png)

mecab-client


MeCab client library written in TypeScript


## ๐Ÿš€ Installation

```bash
npm install mecab-client
# or
yarn add mecab-client
```

## ๐Ÿ”ง Usage

```ts
import { MeCab } from 'mecab-client'

const main = async () => {
const mecab = new MeCab()

const result = await mecab.parse("ใ™ใ‚‚ใ‚‚ใ‚‚ใ‚‚ใ‚‚ใ‚‚ใ‚‚ใ‚‚ใฎใ†ใก")
console.log(result)
}

main()
```

## ๐Ÿ’ก API

## `MeCab#parse(source: string): Word[]`

- ไธŽใˆใ‚‰ใ‚ŒใŸๆ–‡ๅญ—ๅˆ—ใ‚’่งฃๆžใ— `Word[]` ใ‚’่ฟ”ใ—ใพใ™ใ€‚

## `Word` type

```ts
/**
* Word type.
*/
export type Word = {
/**
* ่กจๅฑค็ณป
*/
surface: string

/**
* ๅ“่ฉž
*/
lexical: Lexical

/**
* ๅ“่ฉž็ดฐๅˆ†้กž1
*/
compound1: string

/**
* ๅ“่ฉž็ดฐๅˆ†้กž2
*/
compound2: string

/**
* ๅ“่ฉž็ดฐๅˆ†้กž3
*/
compound3: string

/**
* ๆดป็”จๅž‹
*/
conjugation: string

/**
* ๆดป็”จๅฝข
*/
inflection: string

/**
* ๅŽŸๅž‹
*/
original: string

/**
* ่ชญใฟ
*/
reading: string

/**
* ็™บ้Ÿณ
*/
pronunciation?: string
}
```