Skip to content

Instantly share code, notes, and snippets.

@golbin
Created April 9, 2016 15:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save golbin/581b2365692629a3e837d6c2081cf064 to your computer and use it in GitHub Desktop.
Save golbin/581b2365692629a3e837d6c2081cf064 to your computer and use it in GitHub Desktop.
mecab-ya examples
var mecab = require('mecab-ya');
var text = '아버지가방에들어가신다';
mecab.pos(text, function (err, result) {
console.log(result);
/*
[ [ '아버지', 'NNG' ],
[ '가', 'JKS' ],
[ '방', 'NNG' ],
[ '에', 'JKB' ],
[ '들어가', 'VV' ],
[ '신다', 'EP+EC' ] ]
*/
});
mecab.morphs(text, function (err, result) {
console.log(result);
/*
[ '아버지', '가', '방', '에', '들어가', '신다' ]
*/
});
mecab.nouns(text, function (err, result) {
console.log(result);
/*
[ '아버지', '방' ]
*/
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment