Skip to content

Instantly share code, notes, and snippets.

@baltpeter baltpeter/treetagger.js
Last active Aug 29, 2015

Embed
What would you like to do?
Given a plain text wordlist, output all words from that list that are nouns
var Treetagger = require('treetagger');
var tagger = new Treetagger({ language: "french" });
var fs = require('fs'), filename = "/Users/benni/coding/tt-nodejs/french.txt";
fs.readFile(filename, 'utf8', function(err, data) {
if(err) throw err;
tagger.tag(data, function (err, results) {
results.forEach(function(e) {
if(e.pos == "NOM") {
console.log(e.t);
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.