edu.stanford.nlp.ie.regexp
Class RegexpsFieldExtractor

java.lang.Object
  |
  +--edu.stanford.nlp.ie.AbstractFieldExtractor
        |
        +--edu.stanford.nlp.ie.regexp.RegexpsFieldExtractor
All Implemented Interfaces:
FieldExtractor, RankedExtractor, Serializable

public class RegexpsFieldExtractor
extends AbstractFieldExtractor

An implmentation of the general FieldExtractor interfaces which fills in multiple fields by matching various regular expressions. Provides basic functionality for write serialization.

See Also:
Serialized Form

Constructor Summary
RegexpsFieldExtractor(String[] conceptNames, String[] fieldNames, int[] groups, String[] reStrs)
          Create a new RegexpsFieldExtractor.
 
Method Summary
 edu.unika.aifb.kaon.Instance extractFields(edu.unika.aifb.kaon.Instance inst, String text)
          Returns the given Instance with the extractable fields (if any) inserted.
 String getDescription()
          Returns a description of this RegexpExtractor specifying the size and first name and regexp.
 edu.unika.aifb.kaon.Relation[] getExtractableFields(edu.unika.aifb.kaon.Concept c)
          Returns the set of Relations that this FieldExtractor knows how to extract for the given Concept.
 
Methods inherited from class edu.stanford.nlp.ie.AbstractFieldExtractor
extractFields, isFieldExtractable, storeExtractor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegexpsFieldExtractor

public RegexpsFieldExtractor(String[] conceptNames,
                             String[] fieldNames,
                             int[] groups,
                             String[] reStrs)
                      throws IllegalArgumentException
Create a new RegexpsFieldExtractor.

Parameters:
conceptNames - an array of concepts that can be extracted
fieldNames - an array of fields to extract
groups - an array of specifications of the re group to keep
reStrs - an array of text regular expressions (of the same size as fieldNames) which will match each one
Throws:
IllegalArgumentException - We through this more general exception, so that we can changed regexp packages without having to change the API.
Method Detail

getExtractableFields

public edu.unika.aifb.kaon.Relation[] getExtractableFields(edu.unika.aifb.kaon.Concept c)
Returns the set of Relations that this FieldExtractor knows how to extract for the given Concept. Returned array may be empty (if no fields for the given concept are extractable) but will never be null. Implementing classes may ignore the given Concept if they return domain independent relations.


extractFields

public edu.unika.aifb.kaon.Instance extractFields(edu.unika.aifb.kaon.Instance inst,
                                                  String text)
Returns the given Instance with the extractable fields (if any) inserted.


getDescription

public String getDescription()
Returns a description of this RegexpExtractor specifying the size and first name and regexp.



Stanford NLP Group