emolib.pos
Class POSTagger

java.lang.Object
  extended by emolib.util.proc.TextDataProcessor
      extended by emolib.pos.POSTagger
All Implemented Interfaces:
Configurable, DataProcessor
Direct Known Subclasses:
EnglishStanford, SpanishQTag

public abstract class POSTagger
extends TextDataProcessor

The POSTagger abstract class defines the general structure to perform the Part-Of-Speech (POS) tagging process, which determines the correct function of a word in a sentence.

Nouns, adjectives and verbs share the same regular expression, thus their function cannot be inferred with a simple tokeniser. These classes of word need to be disambiguated according to the context where they appear.

In order to overcome this problem, two approaches can be presented:

Any well coded POS tagger should set the incoming words as nouns, verbs or adjectives according to the results obtained.

Author:
Alexandre Trilla (atrilla@salle.url.edu)

Constructor Summary
POSTagger()
          Main constructor of the POSTagger.
 
Method Summary
abstract  void applyPOSTagging(TextData inputTextDataObject)
          Method to perform the POS tagging process.
 Data getData()
          Obtains the TextData from the previous module, processes it and makes it available to the rest of the text processing chain.
 void initialize()
          Method to initialize the POSTagger.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component has new data.
 void register(java.lang.String name, Registry registry)
          Register my properties.
 
Methods inherited from class emolib.util.proc.TextDataProcessor
flush, getName, getPredecessor, setPredecessor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

POSTagger

public POSTagger()
Main constructor of the POSTagger.

Method Detail

register

public void register(java.lang.String name,
                     Registry registry)
              throws PropertyException
Description copied from interface: Configurable
Register my properties. This method is called once early in the time of the component, shortly after the component is constructed. This component should register any configuration properties that it needs to register. If this configurable extends another configurable, super.register should also be called

Specified by:
register in interface Configurable
Overrides:
register in class TextDataProcessor
Parameters:
name - the name of the component
registry - the registry for this component
Throws:
PropertyException

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component has new data. The component should first validate the data. If it is bad the component should return false. If the data is good, the component should record the the data internally and return true.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class TextDataProcessor
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

getData

public Data getData()
             throws DataProcessingException
Obtains the TextData from the previous module, processes it and makes it available to the rest of the text processing chain.

Specified by:
getData in interface DataProcessor
Specified by:
getData in class TextDataProcessor
Returns:
The next available Data object, returns null if no Data object is available.
Throws:
DataProcessingException - If there is a processing error.

initialize

public void initialize()
Method to initialize the POSTagger.

Specified by:
initialize in interface DataProcessor
Overrides:
initialize in class TextDataProcessor

applyPOSTagging

public abstract void applyPOSTagging(TextData inputTextDataObject)
Method to perform the POS tagging process.

Parameters:
inputTextDataObject - The TextData object to process.