So i just installed MeCab and tried to run it in node.
i took example from this url https://github.com/hecomi/node-mecab-async#readme to check if i installed it properly but i guess something went wrong.
i tried to run the example from documentation
var MeCab = new require('mecab-async')
, mecab = new MeCab()
;
mecab.parse('いつもニコニコあなたの隣に這い寄る混沌ニャルラトホテプです!', function(err, result) {
if (err) throw err;
console.log(result);
});
the result should be
[ [ 'いつも', '副詞', '一般', '*', '*', '*', '*', 'いつも', 'イツモ', 'イツモ' ],
[ 'ニコニコ', '副詞', '助詞類接続', '*', '*', '*', '*', 'ニコニコ', 'ニコニコ', 'ニコニコ' ],
[ 'あなた', '名詞', '代名詞', '一般', '*', '*', '*', 'あなた', 'アナタ', 'アナタ' ],
[ 'の', '助詞', '連体化', '*', '*', '*', '*', 'の', 'ノ', 'ノ' ],
[ '隣', '名詞', '一般', '*', '*', '*', '*', '隣', 'トナリ', 'トナリ' ],
[ 'に', '助詞', '格助詞', '一般', '*', '*', '*', 'に', 'ニ', 'ニ' ],
[ '這い', '動詞', '自立', '*', '*', '五段・ワ行促音便', '連用形', '這う', 'ハイ', 'ハイ' ],
[ '寄る', '動詞', '自立', '*', '*', '五段・ラ行', '基本形', '寄る', 'ヨル', 'ヨル' ],
[ '混沌', '名詞', '一般', '*', '*', '*', '*', '混沌', 'コントン', 'コントン' ],
[ 'ニャルラトホテプ', '名詞', '一般', '*', '*', '*', '*', '*' ],
[ 'です', '助動詞', '*', '*', '*', '特殊・デス', '基本形', 'です', 'デス', 'デス' ],
[ '!', '記号', '一般', '*', '*', '*', '*', '!', '!', '!' ] ]
but what i get is
[
[ '?', '名詞', 'サ変接続', '*', '*', '*', '*', '*r' ],
[ '?', '名詞', 'サ変接続', '*', '*', '*', '*', '*r' ],
[ '?', '名詞', 'サ変接続', '*', '*', '*', '*', '*r' ],
[ '?', '名詞', 'サ変接続', '*', '*', '*', '*', '*r' ],
[ '?', '名詞', 'サ変接続', '*', '*', '*', '*', '*r' ],
[
'????????????????????????!',
'名詞',
'サ変接続',
'*',
'*',
'*',
'*',
'*r'
]
]
does anyone have any idea what i might be doing wrong here?
New contributor
moremondocane is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.