var words = new Lexer().lex("This is some sample text. This text can contain multiple sentences."); var taggedWords = new POSTagger().tag(words); for (i in taggedWords) { var taggedWord = taggedWords[i]; var word = taggedWord[0]; var tag = taggedWord[1]; print(word + " /" + tag); // if running in a browser, try document.writeln() instead of print() }