Class com.phrasys.tagger.Tagger
java.lang.Object
|
+----com.phrasys.tagger.Tagger
- public class Tagger
- extends java.lang.Object
- implements WordListener, java.io.Serializable
Tagger()
- constructor
addMarkup(WordEvent)
- Add an annotation.
addWordListener(WordListener)
- register listeners
getResourceFile()
-
removeWordListener(WordListener)
- de-register listeners
setResourceFile(String)
- Set the resource file to be used by the tagger.
wordReceived(WordEvent)
- Receive a word event.
Tagger
public Tagger()
constructor
setResourceFile
public void setResourceFile(java.lang.String location) throws TaggerException
Set the resource file to be used by the tagger.
The filename is the full pathname of the file.
- Parameters:
location - where the resource file can be found.
getResourceFile
public java.lang.String getResourceFile()
wordReceived
public void wordReceived(WordEvent token)
Receive a word event.
A token is sent across from the tokeniser. This can either be an
annotation or a proper word. The annotation is added to the annotation
buffer, while the word goes to the tag buffer.
- Parameters:
token - the WordEvent from the tokeniser.
addMarkup
public void addMarkup(WordEvent xml)
Add an annotation.
SGML tags are ignored by the tagger, so they are added separately. There
is an array of SGML vectors parallel to the word buffer array, so that SGML
markup is passed through the tagging process transparently. This function
is equivalent to tag, but should be called with markup.
- Parameters:
sgml - a String containing markup that should not be tagged
addWordListener
public void addWordListener(WordListener listener)
register listeners
removeWordListener
public void removeWordListener(WordListener listener)
de-register listeners