edu.stanford.nlp.ie.hmm
Class AnswerConstructor

java.lang.Object
  |
  +--edu.stanford.nlp.ie.hmm.AnswerConstructor
All Implemented Interfaces:
Processor

public class AnswerConstructor
extends Object
implements Processor

Takes a Collection of TypedTaggedWords (or a Collection of Words and a list of integers for the corresponsing types) and pulls out the strings of each type.


Constructor Summary
AnswerConstructor()
          Constructs a new AnswerConstructor without a predefined list of word types.
AnswerConstructor(int[] wordTypes)
          Constructs a new AnswerConstructor with the given predfined list of types for each word that will be passed into process.
 
Method Summary
 Collection process(Collection collection)
          Reads in the given collection of Words and using either the wordTypes passed into the constructor or the types of the words if none were provided to the constructor, pulls out the sequences of words with a non-zero type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnswerConstructor

public AnswerConstructor(int[] wordTypes)
Constructs a new AnswerConstructor with the given predfined list of types for each word that will be passed into process. If wordTypes is null, the word types are pulled from the words when process is called, assuming the words are actually TypedTaggedWords.


AnswerConstructor

public AnswerConstructor()
Constructs a new AnswerConstructor without a predefined list of word types. When process is called, the words passed in will be assumed to be TypedTaggedWords so the types can be read directly off them.

Method Detail

process

public Collection process(Collection collection)
Reads in the given collection of Words and using either the wordTypes passed into the constructor or the types of the words if none were provided to the constructor, pulls out the sequences of words with a non-zero type. Returns a collection of word lists, one for each run of non-zero type words.

Specified by:
process in interface Processor


Stanford NLP Group