edu.washington.cs.knowitall.extractor
Class RegexRelationExtractor
java.lang.Object
edu.washington.cs.knowitall.extractor.Extractor<ChunkedSentence,ChunkedExtraction>
edu.washington.cs.knowitall.extractor.RegexRelationExtractor
public class RegexRelationExtractor
- extends Extractor<ChunkedSentence,ChunkedExtraction>
An extractor that uses a regular expression pattern over POS tags and tokens to extract
relations from NP-chunked sentences. This class uses a PosTaggedPattern
object
to represent the regular expression pattern.
- Author:
- afader
Constructor Summary |
RegexRelationExtractor(java.lang.String patternString)
Constructs a new RegexRelationExtractor using the given pattern. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegexRelationExtractor
public RegexRelationExtractor(java.lang.String patternString)
- Constructs a new
RegexRelationExtractor
using the given pattern.
- Parameters:
patternString
- the relation pattern
getPatternString
public java.lang.String getPatternString()
- Returns:
- the
String
relation pattern.
getPattern
public PosTaggedPattern getPattern()
- Returns:
- the
PosTaggedPattern
used to extract relations.
extractCandidates
public java.lang.Iterable<ChunkedExtraction> extractCandidates(ChunkedSentence sentence)
- Description copied from class:
Extractor
- Extracts candidate extractions from the given source object. When the user calls the
extract(S source)
method, the extractCandidate(S source)
method is
used to generate a set of candidate extractions, which are then passed through each Mapper
object assigned 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.