Experimenting with natural language modules
var pos = require("pos");
// Note; I don't think this library will currently work because it is large and
// it looks like tonicdev has a restriction on size.
var tagger = new pos.Tagger();
var output = {
}
var taggedWords = tagger.tag(new pos.Lexer().lex('I want a big apartment that is dog friendly'));
for (var i in taggedWords) {
var taggedWord = taggedWords[i];
var pos = taggedWord[1];
var word = taggedWord[0];
if (output[pos]) {
output[pos].push(word);
} else {
output[pos] = [word];
}
}
output;
no comments