morphological analyzer for Japanese with kuromoji
npm install @tomsd/morphoanalyzerIt is a morphological analyzer for Japanese with kuromoji.
!ci
!checks
!top language
!Maintenance
!depends on node greater or equal 18
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);
``