0.0.1 โ€ข Published 4 years ago

mecab-client v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

mecab-client

๐Ÿš€ Installation

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

๐Ÿ”ง Usage

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

/**
 * 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
}