edu.stanford.nlp.ie
Class AbstractFieldExtractor

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

public abstract class AbstractFieldExtractor
extends Object
implements FieldExtractor, Serializable, RankedExtractor

Abstract superclass for implementations of the FieldExtractor interface. Provides basic functionality for write serialization. Shallowly implements RankedExtractor, in that no confidence rankings are actually specified. Added 6/4/02: Support for merging compatible instances through the implementation of RankedExtractor.

See Also:
Serialized Form

Constructor Summary
AbstractFieldExtractor()
           
 
Method Summary
 edu.unika.aifb.kaon.Instance extractFields(edu.unika.aifb.kaon.Instance i, String text, Confidence c)
          The one method for compliance with the RankedExtractor interface.
 boolean isFieldExtractable(edu.unika.aifb.kaon.Concept c, edu.unika.aifb.kaon.Relation r)
          Default implementation, that simply looks through the results of getExtractableFields(Concept) to see if the given Relation is extractable.
 void storeExtractor(File out)
          Serializes this FieldExtractor to the given output file.
 String toString()
          Returns the value of getDescription() as the String representation of this Object.
 
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
extractFields, getDescription, getExtractableFields
 

Constructor Detail

AbstractFieldExtractor

public AbstractFieldExtractor()
Method Detail

isFieldExtractable

public boolean isFieldExtractable(edu.unika.aifb.kaon.Concept c,
                                  edu.unika.aifb.kaon.Relation r)
Default implementation, that simply looks through the results of getExtractableFields(Concept) to see if the given Relation is extractable. Subclasses that support a large number of Relations may wish to override this for performance reasons.

Specified by:
isFieldExtractable in interface FieldExtractor

storeExtractor

public void storeExtractor(File out)
                    throws IOException
Serializes this FieldExtractor to the given output file. Throws an IOException if there is a problem with serialization (e.g. if it can't get write permission to the given File.

Specified by:
storeExtractor in interface FieldExtractor
IOException

toString

public String toString()
Returns the value of getDescription() as the String representation of this Object.

Overrides:
toString in class Object

extractFields

public edu.unika.aifb.kaon.Instance extractFields(edu.unika.aifb.kaon.Instance i,
                                                  String text,
                                                  Confidence c)
The one method for compliance with the RankedExtractor interface. It ignores the Confidence object; thus, subclasses should override this method if more functionality is required.

Specified by:
extractFields in interface RankedExtractor
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