edu.upenn.cis.taggers
Interface Tagger

All Known Implementing Classes:
GeneTagger, MalignancyTagger, VariationTagger

public interface Tagger

All taggers intended to be run on MEDLINE data should implement this interface. It is expected that they will have constructors that take one argument -- a string with the filename of a model they will read in using ObjectInputStreams. The tag() method may throw an IOException; all other methods must have their errors handled internally.


Method Summary
 java.lang.String[] htmlCloseTags()
          Returns a string array of the HTML tags that should follow each tagged entity.
 java.lang.String htmlHeader()
          Returns the header that should be written to an HTML output file.
 java.lang.String[] htmlOpenTags()
          Returns a string array of the HTML tags that should precede each tagged entity.
 java.lang.String[] medlineTags()
          Returns a string array of the MEDLINE tags that should be written to the MEDLINE file.
 java.lang.String tag(java.lang.String in)
          Returns the input String with xml tagging inline.
 java.lang.String[] xmlTags()
          Returns a string array of the xml tags this tagger may insert.
 

Method Detail

tag

java.lang.String tag(java.lang.String in)
                     throws java.io.IOException
Returns the input String with xml tagging inline. The model file used for this should have already been loaded in the Tagger's constructor.

Parameters:
in - The String to be tagged and returned
Returns:
The String tagged with XML data inline
Throws:
java.io.IOException

htmlHeader

java.lang.String htmlHeader()
Returns the header that should be written to an HTML output file. This should include, at bare minimum, HTML and BODY tags, but may have other information as well, such as a legend for the document.

Returns:
The HTML header

xmlTags

java.lang.String[] xmlTags()
Returns a string array of the xml tags this tagger may insert. Should be the complete opening tag, with brackets.

Returns:
An array of XML tags, complete with brackets

medlineTags

java.lang.String[] medlineTags()
Returns a string array of the MEDLINE tags that should be written to the MEDLINE file. Should correspond to the XML tags -- that is, the data tagged by xmlTags()[i] will be written out to MEDLINE tag medlineTags()[i]. Should be no longer than 4 characters, but may be shorter.

Returns:
An array of MEDLINE tags

htmlOpenTags

java.lang.String[] htmlOpenTags()
Returns a string array of the HTML tags that should precede each tagged entity. These should correspond in order to the xmlTags array.

Returns:
An array of HTML tags to be written before tagged data

htmlCloseTags

java.lang.String[] htmlCloseTags()
Returns a string array of the HTML tags that should follow each tagged entity. These should correspond in order to the xmlTags array.

Returns:
An array of HTML tags to be written after tagged data