edu.washington.cs.knowitall.extractor
Class ExtractorUnion<S,T>

java.lang.Object
  extended by edu.washington.cs.knowitall.extractor.Extractor<S,T>
      extended by edu.washington.cs.knowitall.extractor.ExtractorUnion<S,T>
Type Parameters:
S -
T -

public class ExtractorUnion<S,T>
extends Extractor<S,T>

Takes the union of the output of multiple extractors. The output of this extractor is the output of the others concatenated together.

Author:
afader

Constructor Summary
ExtractorUnion()
          Constructs an empty extractor that will return an empty set of results from any given input.
ExtractorUnion(java.util.List<Extractor<S,T>> extractors)
          Constructs a new extractor that returns the union of the output from each of the given extractors.
 
Method Summary
 void addExtractor(Extractor<S,T> extractor)
          Adds the given extractor to the union.
protected  java.lang.Iterable<T> extractCandidates(S source)
          Returns the results from each extractor.
 
Methods inherited from class edu.washington.cs.knowitall.extractor.Extractor
addMapper, compose, extract, extract, getMappers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtractorUnion

public ExtractorUnion()
Constructs an empty extractor that will return an empty set of results from any given input.


ExtractorUnion

public ExtractorUnion(java.util.List<Extractor<S,T>> extractors)
Constructs a new extractor that returns the union of the output from each of the given extractors.

Parameters:
extractors -
Method Detail

addExtractor

public void addExtractor(Extractor<S,T> extractor)
Adds the given extractor to the union.

Parameters:
extractor -

extractCandidates

protected java.lang.Iterable<T> extractCandidates(S source)
Returns the results from each extractor. If there are no extractors in the union, returns an empty Iterable.

Specified by:
extractCandidates in class Extractor<S,T>
Parameters:
source - The source to extract from.
Returns:
An Iterable object over the candidate extractions.