textmaven.application.analyzer.annotator
Class Annotator

java.lang.Object
  extended bytextmaven.application.analyzer.annotator.Annotator
All Implemented Interfaces:
ITextHandler

public class Annotator
extends java.lang.Object
implements ITextHandler

Annotates text word by word with hyperlinks to a vocabulary file. The vocabulary file has to be generated with the Translator using the word list generated by the WordExtractor.

Author:
krebtho

Constructor Summary
Annotator()
          Standard constructor
Annotator(HTMLWriter writer, IExclusionList list, IDictionary dict)
          Constructor
 
Method Summary
 void endParagraph()
          Called when a paragraph ends
 void endSentence(java.lang.String sentence, char punctuation)
          Called when the sentence ended.
 void endText()
          Writes HTML footer
 IDictionary getDictionary()
           
 IExclusionList getExclusionList()
           
 HTMLWriter getWriter()
           
 void heading(int depth, java.lang.String title)
          Called when a heading was read.
 void setDictionary(IDictionary dictionary)
           
 void setExclusionList(IExclusionList exclusionList)
           
 void setWriter(HTMLWriter writer)
           
 void startParagraph()
          Writes bookmark if threshold reached
 void startSentence()
          Called when a new sentence starts.
 void startText()
          Writes HTML header
 void word(java.lang.String word)
          Get stem and passes word to the HTML writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Annotator

public Annotator()
Standard constructor


Annotator

public Annotator(HTMLWriter writer,
                 IExclusionList list,
                 IDictionary dict)
Constructor

Parameters:
writer - HTMLWriter to be used
list - exclusion list
dict - dictionary used for stemming
Method Detail

startText

public void startText()
Writes HTML header

Specified by:
startText in interface ITextHandler
See Also:
ITextHandler.startText()

endText

public void endText()
Writes HTML footer

Specified by:
endText in interface ITextHandler
See Also:
ITextHandler.endText()

startParagraph

public void startParagraph()
Writes bookmark if threshold reached

Specified by:
startParagraph in interface ITextHandler
See Also:
ITextHandler.startParagraph()

endParagraph

public void endParagraph()
Description copied from interface: ITextHandler
Called when a paragraph ends

Specified by:
endParagraph in interface ITextHandler

startSentence

public void startSentence()
Description copied from interface: ITextHandler
Called when a new sentence starts.

Specified by:
startSentence in interface ITextHandler

endSentence

public void endSentence(java.lang.String sentence,
                        char punctuation)
Description copied from interface: ITextHandler
Called when the sentence ended.

Specified by:
endSentence in interface ITextHandler
Parameters:
sentence - Sentence read, incl. punctuation char.
punctuation - Punctuation character terminating the sentence

heading

public void heading(int depth,
                    java.lang.String title)
Description copied from interface: ITextHandler
Called when a heading was read.

Specified by:
heading in interface ITextHandler
Parameters:
depth - heading depth
title - heading title

word

public void word(java.lang.String word)
Get stem and passes word to the HTML writer.

Specified by:
word in interface ITextHandler
Parameters:
word - word read
See Also:
ITextHandler.word(java.lang.String)

getDictionary

public IDictionary getDictionary()
Returns:
Returns the dictionary.

setDictionary

public void setDictionary(IDictionary dictionary)
Parameters:
dictionary - The dictionary to set.

getWriter

public HTMLWriter getWriter()
Returns:
Returns the writer.

setWriter

public void setWriter(HTMLWriter writer)
Parameters:
writer - The writer to set.

getExclusionList

public IExclusionList getExclusionList()
Returns:
Returns the exclusionList.

setExclusionList

public void setExclusionList(IExclusionList exclusionList)
Parameters:
exclusionList - The exclusionList to set.


Copyright © 2002-2005 Sourceforge. All Rights Reserved.