Last active
August 29, 2015 14:08
-
-
Save baltpeter/058b55099cf3062d8890 to your computer and use it in GitHub Desktop.
Given a plain text wordlist, output all words from that list that are nouns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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