Comments (1)
cd kuromoji.js
npm install gulp
・・・npm installとかしちゃいけない、、、gulpのみ追加する
<以下から辞書をダウンロードして解凍しておく>
https://github.com/neologd/mecab-ipadic-neologd/tree/master/seed
mecab-user-dict-seed.20200910.csv.xz
cp ../mecabdic/mecab-user-dict-seed.20200910.csv ./node_modules/mecab-ipadic-seed/lib/dict/.
<何回か実行して、Out of memoryが出て止まったので、メモリ増やしました>
gulp build-dict --max_old_space_size=5120
vi sample.js
"use strict";
var kuromoji = require("./src/kuromoji");
var DIC_DIR = "dict/";
// Load dictionaries from file, and prepare tokenizer
kuromoji.builder({ dicPath: DIC_DIR }).build(function (error, tokenizer) {
var path = tokenizer.tokenize("鬼滅の刃ととなりのトトロはどちらが面白い");
console.log(path);
module.exports = tokenizer;
});
node sample.js |more
<分析結果>
[
{
word_id: 35387780,
word_type: 'KNOWN',
word_position: 1,
surface_form: '鬼滅の刃',
pos: '名詞',
pos_detail_1: '固有名詞',
pos_detail_2: '一般',
pos_detail_3: '',
conjugated_type: '',
conjugated_form: '',
basic_form: '鬼滅の刃',
reading: 'キメツノヤイバ',
pronunciation: 'キメツノヤイバ'
},
{
word_id: 77960,
word_type: 'KNOWN',
word_position: 5,
surface_form: 'と',
pos: '助詞',
pos_detail_1: '並立助詞',
pos_detail_2: '',
pos_detail_3: '',
conjugated_type: '',
conjugated_form: '',
basic_form: 'と',
reading: 'ト',
pronunciation: 'ト'
},
{
word_id: 8261830,
word_type: 'KNOWN',
word_position: 6,
surface_form: 'となりのトトロ',
pos: '名詞',
pos_detail_1: '固有名詞',
pos_detail_2: '一般',
pos_detail_3: '',
conjugated_type: '',
conjugated_form: '',
basic_form: 'となりのトトロ',
reading: 'トナリノトトロ',
pronunciation: 'トナリノトトロ'
},
{
word_id: 77850,
word_type: 'KNOWN',
word_position: 13,
surface_form: 'は',
pos: '助詞',
pos_detail_1: '係助詞',
、、、略、、、
from kuromoji.js.
Related Issues (20)
- Wrong pos?
- User dictionary support HOT 1
- Infection blocked ( at avast ) HOT 2
- How do you import a dictionary in React Native?
- Not getting the same results as Kuromoji java HOT 3
- 「見れる」の解析結果がおかしい HOT 2
- Phraze tokenized as single token HOT 3
- Using only kanji->kana data HOT 2
- gzip library not needed in the browser version
- 、 as 名詞 数
- 微笑み is broken down to 微 and 笑み HOT 1
- Can not load dict from external URL HOT 2
- Builder wont accept url to data folder in chrome extension HOT 1
- kuromoji-vercel
- ローカルでは動くのに、Webサーバー上ではkuromoji.jsが動作しません HOT 8
- This repository is not maintained now? HOT 3
- can't resolve path . HOT 1
- Doesn't work in Firefox because of error in loading array buffer
- byte length of Int16Array should be a multiple of 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kuromoji.js.