edu.cmu.minorthird.text.learn
Class ExtractorAnnotatorWrapper

java.lang.Object
  extended by edu.cmu.minorthird.text.learn.ExtractorAnnotatorWrapper

public class ExtractorAnnotatorWrapper
extends java.lang.Object

Wraps an ExtractorAnnotator with some code to implement a simple API.


Constructor Summary
ExtractorAnnotatorWrapper(ExtractorAnnotator annotator)
          Construct from an annotator that implements the ExtractorAnnotator interface.
ExtractorAnnotatorWrapper(java.io.File file)
          Construct from a file containing a serialized extractor, as would be learned by TrainExtractor.
ExtractorAnnotatorWrapper(java.io.InputStream stream)
          Construct from an InputStream containing a serialized extractor, as would be learned by TrainExtractor.
 
Method Summary
 java.lang.String[] extractFrom(java.lang.String source)
          Apply the wrapped annotator to a string, and return all substrings extracted.
 ExtractorAnnotator getAnnotator()
           
static void main(java.lang.String[] args)
          An interactive test routine to see if this thing works.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtractorAnnotatorWrapper

public ExtractorAnnotatorWrapper(java.io.File file)
                          throws java.io.IOException
Construct from a file containing a serialized extractor, as would be learned by TrainExtractor.

Throws:
java.io.IOException

ExtractorAnnotatorWrapper

public ExtractorAnnotatorWrapper(java.io.InputStream stream)
                          throws java.io.IOException
Construct from an InputStream containing a serialized extractor, as would be learned by TrainExtractor.

Throws:
java.io.IOException

ExtractorAnnotatorWrapper

public ExtractorAnnotatorWrapper(ExtractorAnnotator annotator)
Construct from an annotator that implements the ExtractorAnnotator interface.

Method Detail

getAnnotator

public ExtractorAnnotator getAnnotator()

extractFrom

public java.lang.String[] extractFrom(java.lang.String source)
Apply the wrapped annotator to a string, and return all substrings extracted.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
An interactive test routine to see if this thing works.

Throws:
java.lang.Exception