https://github.com/sera1mu/deno_mecab
🇯🇵 Analyze Japanese from Deno with MeCab
https://github.com/sera1mu/deno_mecab
deno deno-module javascript mecab typescript
Last synced: 4 months ago
JSON representation
🇯🇵 Analyze Japanese from Deno with MeCab
- Host: GitHub
- URL: https://github.com/sera1mu/deno_mecab
- Owner: sera1mu
- License: mit
- Created: 2021-08-08T01:54:25.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-18T23:37:32.000Z (about 3 years ago)
- Last Synced: 2026-02-15T03:43:29.941Z (4 months ago)
- Topics: deno, deno-module, javascript, mecab, typescript
- Language: TypeScript
- Homepage: https://doc.deno.land/https/deno.land/x/deno_mecab/mod.ts
- Size: 104 KB
- Stars: 13
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.ja.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# deno_mecab
[](https://github.com/sera1mu/deno-mecab/actions/workflows/test.yml)
[](https://github.com/sera1mu/deno-mecab/actions/workflows/check-code.yml)
[](https://codeclimate.com/github/sera1mu/deno-mecab/test_coverage)
[](https://codeclimate.com/github/sera1mu/deno-mecab/maintainability)
[](https://github.com/sera1mu/deno-mecab/blob/main/LICENSE)
### [English](https://github.com/sera1mu/deno-mecab/blob/main/README.md) | 日本語
deno_mecabは、MeCabを用いた非同期の日本語形態素解析モジュールです。
## Getting Started
### Requirements
- [Deno](https://deno.land)
- [MeCab](https://taku910.github.io/mecab/)
- MeCab 辞書
- [mecab-ipadic](https://github.com/taku910/mecab/tree/master/mecab-ipadic)
- [mecab-jumandic](https://github.com/taku910/mecab/tree/master/mecab-jumandic)
- [mecab-ipadic-neologd](https://github.com/neologd/mecab-ipadic-neologd)
### Example
簡単な例として、これを実行してみてください:
```
deno run --allow-run https://deno.land/x/deno_mecab/example.ts
```
実行されるスクリプト:
```ts
import MeCab from "https://deno.land/x/deno_mecab@v1.2.2/mod.ts";
const mecab = new MeCab(["mecab"]);
const text = "JavaScriptはとても楽しいです。";
// Parse (形態素解析)
console.log(await mecab.parse(text));
// [{surface: "JavaScript", feature: "名詞", featureDetails: [ "固有名詞", "組織", "*" ], ...
// Dump (ダンプ出力)
console.log(await mecab.dump(text));
// [{nodeId: 0, surface: "BOS", feature: "BOS/EOS", featureDetails: [ "*", "*", "*" ], ...
// Wakati (わかち書き)
console.log(await mecab.wakati("JavaScriptはとても楽しいです。"));
// [ "JavaScript", "は", "とても", "楽しい", "です", "。" ]
// Yomi (読み付与)
console.log(await mecab.yomi("日本語"));
// ニホンゴ
```
## Maintainer
[@sera1mu](https://github.com/sera1mu)
## License
MIT © 2021 Seraimu