| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectemolib.util.proc.TextDataProcessor
emolib.AffectiveTagger
public class AffectiveTagger
The AffectiveTagger is a wrapper class for the chain of Text Data Processors that perform the emotional tagging of the incoming text. It provides methods for manipulating and navigating the processors.
The AffectiveTagger is modelled as a pipeline of Text Data Processors, each of which performs a specific Natural Language Processing (NLP) task.
 This class is based on the Sphinx-4 FrontEnd class with the appropriate
 Text Data objects. It follows the Sphinx-4 implementation in order to friendly
 interact with the ConfigurationManager, a very
 useful tool to deal with the configuration issues. More information about the
 interfaces that must be implemented, the Pull Model, the configuration and the
 usage of this class is to be found in the documentation of the Sphinx-4
 FrontEnd.
 
 The AffectiveTagger implemented for EmoLib proposes that the Data objects that
 carry the actual information should be of the
 TextData class, i.e., the main data structure,
 and the processors chained in the pipeline should
 extend the TextDataProcessor abstract class.
 These two classes implement the interfaces required by the Configuration Manager.
 
The arrangement of the selected Text Data Processors is given by the external configuration file in XML format, treated by the Configuration Manager.
The tagger provides the tools to input data into the processing pipeline as well as to retrieve the results from the pipeline through the "inputData" and "outputData" methods. These methods MUST be implemented by the first and the last modules of the pipeline, namely the INPUTTER and OUTPUTTER. Otherwise, the application will report the problem and crash.
| Field Summary | |
|---|---|
| static java.lang.String | PROP_EMOLIB_PATHThe name of the property that defines the root path of EmoLib. | 
| static java.lang.String | PROP_LANGUAGEThe name of the property that defines the language of the system. | 
| static java.lang.String | PROP_PIPELINEThe name of the property list of all the components of the AffectiveTagger pipe line. | 
| Constructor Summary | |
|---|---|
| AffectiveTagger() | |
| Method Summary | |
|---|---|
|  void | flush()Method to flush the previous partial results of this TextDataProcessor. | 
|  Data | getData()Returns the processed Data output, basically calls getData()on the last processor. | 
|  java.lang.String | getEmoLibPath()Function that returns the root path of EmoLib. | 
|  java.lang.String | getLanguage()Function that returns the language of the AffectiveTagger. | 
|  void | initialize()Initializes this DataProcessor. | 
|  Data | inputData(java.lang.String inData)Function to input and process data. | 
|  void | newProperties(PropertySheet ps)This method is called when this configurable component has new data. | 
|  void | outputData()Method to issue the Tagger to output the results. | 
|  void | outputData(java.io.File file)Method to issue the Tagger to output the results into a determined file. | 
|  TextData | processText(java.lang.String text)Function to process textual data. | 
|  void | register(java.lang.String name,
         Registry registry)Register my properties. | 
|  void | setPredecessor(DataProcessor dataSource)Sets the source of Data for this AffectiveTagger. | 
|  java.lang.String | toString()Returns a description of this AffectiveTagger in the format: | 
| Methods inherited from class emolib.util.proc.TextDataProcessor | 
|---|
| getName, getPredecessor | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final java.lang.String PROP_PIPELINE
public static final java.lang.String PROP_LANGUAGE
public static final java.lang.String PROP_EMOLIB_PATH
| Constructor Detail | 
|---|
public AffectiveTagger()
| Method Detail | 
|---|
public void register(java.lang.String name,
                     Registry registry)
              throws PropertyException
Configurable
register in interface Configurableregister in class TextDataProcessorname - the name of the componentregistry - the registry for this component
PropertyException
public void newProperties(PropertySheet ps)
                   throws PropertyException
Configurable
newProperties in interface ConfigurablenewProperties in class TextDataProcessorps - a property sheet holding the new data
PropertyException - if there is a problem with the properties.public void initialize()
DataProcessor
initialize in interface DataProcessorinitialize in class TextDataProcessorpublic void flush()
TextDataProcessor
flush in class TextDataProcessor
public Data getData()
             throws DataProcessingException
getData() on the last processor.
getData in interface DataProcessorgetData in class TextDataProcessorDataProcessingException - If a Data Processor error occurs.public void setPredecessor(DataProcessor dataSource)
setDataSource(dataSource).
setPredecessor in interface DataProcessorsetPredecessor in class TextDataProcessordataSource - The source of Data.public java.lang.String toString()
toString in class TextDataProcessorpublic java.lang.String getLanguage()
public java.lang.String getEmoLibPath()
public Data inputData(java.lang.String inData)
inData - The text to be inputted.
public TextData processText(java.lang.String text)
text - The text to process.
public void outputData()
public void outputData(java.io.File file)
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||