edu.stanford.nlp.ie
Class SingleFieldExtractor

java.lang.Object
  |
  +--edu.stanford.nlp.ie.AbstractFieldExtractor
        |
        +--edu.stanford.nlp.ie.SingleFieldExtractor
All Implemented Interfaces:
FieldExtractor, RankedExtractor, Serializable
Direct Known Subclasses:
DescExtractor, HMMSingleFieldExtractor, RegexpExtractor

public abstract class SingleFieldExtractor
extends AbstractFieldExtractor

Superclass of FieldExtractors that only return a single (literal) field. Implements the FieldExtractor interface and in turn presents a simpler, more tailored set of abstract methods for subclasses to override. Added 6/4/02: extractField(Instance, String, Confidence) and extractFields(Instance, String, Confidence), for rudimentary merging functionality.

See Also:
Serialized Form

Constructor Summary
SingleFieldExtractor()
           
 
Method Summary
abstract  String extractField(edu.unika.aifb.kaon.Instance i, String text)
          Subclasses should override this method to perform extraction from the given text.
 String extractField(edu.unika.aifb.kaon.Instance i, String text, Confidence c)
          Subclasses that support confidence rankings on extraction results should override this method, otherwise a default -1 ranking will be given as the Confidence ranking.
 edu.unika.aifb.kaon.Instance extractFields(edu.unika.aifb.kaon.Instance i, String text)
          Returns the given Instance with the extracted field (if any) inserted.
 edu.unika.aifb.kaon.Instance extractFields(edu.unika.aifb.kaon.Instance i, String text, Confidence c)
          Identical to extractFields(Instance,String) except that a Confidence object is expected.
abstract  String getExtractableField(edu.unika.aifb.kaon.Concept c)
          Subclasses should override this method to return the name of the Relation they know how to extract, or null if this field is not supported for the given Concept.
 edu.unika.aifb.kaon.Relation[] getExtractableFields(edu.unika.aifb.kaon.Concept c)
          Returns the result of getExtractableField(Concept) turned into a 0 or 1 element array.
 
Methods inherited from class edu.stanford.nlp.ie.AbstractFieldExtractor
isFieldExtractable, storeExtractor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.stanford.nlp.ie.FieldExtractor
getDescription
 

Constructor Detail

SingleFieldExtractor

public SingleFieldExtractor()
Method Detail

getExtractableField

public abstract String getExtractableField(edu.unika.aifb.kaon.Concept c)
Subclasses should override this method to return the name of the Relation they know how to extract, or null if this field is not supported for the given Concept.


extractField

public abstract String extractField(edu.unika.aifb.kaon.Instance i,
                                    String text)
Subclasses should override this method to perform extraction from the given text. The Instance is provided only as a potentially additional source of information. Subclasses should just return the extracted text as a String, or null if no field is found in the given text.


getExtractableFields

public edu.unika.aifb.kaon.Relation[] getExtractableFields(edu.unika.aifb.kaon.Concept c)
Returns the result of getExtractableField(Concept) turned into a 0 or 1 element array. Assumes that c is a real concept, not null.

Parameters:
c - The concept to get fields for
Returns:
An array of relations that it can extract

extractFields

public edu.unika.aifb.kaon.Instance extractFields(edu.unika.aifb.kaon.Instance i,
                                                  String text)
Returns the given Instance with the extracted field (if any) inserted.


extractField

public String extractField(edu.unika.aifb.kaon.Instance i,
                           String text,
                           Confidence c)
Subclasses that support confidence rankings on extraction results should override this method, otherwise a default -1 ranking will be given as the Confidence ranking.

Parameters:
i - the Instance to fill
text - the text to extract from
c - the Confidence object to modify
Returns:
the result of the extraction

extractFields

public edu.unika.aifb.kaon.Instance extractFields(edu.unika.aifb.kaon.Instance i,
                                                  String text,
                                                  Confidence c)
Identical to extractFields(Instance,String) except that a Confidence object is expected.

Specified by:
extractFields in interface RankedExtractor
Overrides:
extractFields in class AbstractFieldExtractor
Parameters:
i - the original Instance to extract into
text - the text from which to extract
c - the Confidence object corresponding to the Instance passed in, which stores numerical confidence ratings for the extracted fields
Returns:
the updated Instance


Stanford NLP Group