Example usage for edu.stanford.nlp.tagger.maxent MaxentTagger process

List of usage examples for edu.stanford.nlp.tagger.maxent MaxentTagger process

Introduction

In this page you can find the example usage for edu.stanford.nlp.tagger.maxent MaxentTagger process.

Prototype

@Override
public List<List<TaggedWord>> process(List<? extends List<? extends HasWord>> sentences) 

Source Link

Document

Tags the Words in each Sentence in the given List with their grammatical part-of-speech.

Usage

From source file:org.karsha.base.EnglishLemmaTokenizer.java

License:Open Source License

/**
 * Construct a tokenizer processing the given input using the given tagger.
 *///  w  w  w. ja v a 2s.  c  om

public EnglishLemmaTokenizer(Reader input, MaxentTagger tagger) {
    super();

    lemmaNext = false;
    posIncr = addAttribute(PositionIncrementAttribute.class);
    termAtt = addAttribute(TermAttribute.class);
    List<List<HasWord>> tokenized = MaxentTagger.tokenizeText(input);
    //List<ArrayList<? extends HasWord>> tokenized =MaxentTagger.tokenizeText(input);

    tagged = Iterables.concat(tagger.process(tokenized)).iterator();
}