edu.washington.cs.knowitall.extractor
Class RegexExtractor

java.lang.Object
  extended by edu.washington.cs.knowitall.extractor.Extractor<ChunkedSentence,ChunkedExtraction>
      extended by edu.washington.cs.knowitall.extractor.RegexExtractor

public class RegexExtractor
extends Extractor<ChunkedSentence,ChunkedExtraction>

An extractor that uses a regular expression pattern relations from NP-chunked sentences. This class uses a LayeredTokenPattern object to represent the regular expression pattern.

Author:
afader

Constructor Summary
RegexExtractor(String patternString)
          Constructs a new instance using the given pattern.
 
Method Summary
 Collection<ChunkedExtraction> extractCandidates(ChunkedSentence sentence)
          Extracts candidate extractions from the given source object.
 LayeredTokenPattern getPattern()
           
 String getPatternString()
           
 
Methods inherited from class edu.washington.cs.knowitall.extractor.Extractor
addMapper, compose, extract, getMappers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexExtractor

public RegexExtractor(String patternString)
               throws SequenceException
Constructs a new instance using the given pattern.

Parameters:
pattern - the relation pattern
Throws:
SequenceException - if unable to compile pattern
Method Detail

getPatternString

public String getPatternString()
Returns:
the String relation pattern.

getPattern

public LayeredTokenPattern getPattern()
Returns:
the LayeredTokenPattern used to extract relations.

extractCandidates

public Collection<ChunkedExtraction> extractCandidates(ChunkedSentence sentence)
                                                throws ExtractorException
Description copied from class: Extractor
Extracts candidate extractions from the given source object. When the user calls Extractor.extract(Object), the this method is used to generate a set of candidate extractions, which are then passed through each mapper object attached to the extractor.

Specified by:
extractCandidates in class Extractor<ChunkedSentence,ChunkedExtraction>
Parameters:
sentence - the source to extract from.
Returns:
an iterable object over the candidate extractions.
Throws:
ExtractorException - if unable to extract


Copyright © 2010-2012 University of Washington CSE. All Rights Reserved.