org.ow2.weblab.service.gazetteer.api
Class TextAnnotator

java.lang.Object
  extended by org.ow2.weblab.service.gazetteer.api.TextAnnotator
All Implemented Interfaces:
org.ow2.weblab.core.services.Analyser
Direct Known Subclasses:
AnnotatorFromGazFullRegexp, AnnotatorFromGazMixed

public abstract class TextAnnotator
extends java.lang.Object
implements org.ow2.weblab.core.services.Analyser


Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
TextAnnotator(org.apache.commons.logging.Log logger)
           
 
Method Summary
 void annote(org.ow2.weblab.core.model.Text text, int offset, java.lang.String word, java.lang.String className, java.lang.String label, boolean createAnnotation)
          Create an annotation on a text based on element detected.
protected  java.util.List<org.ow2.weblab.core.model.Text> checkParameters(org.ow2.weblab.core.services.analyser.ProcessArgs args)
           
 org.ow2.weblab.core.services.analyser.ProcessReturn process(org.ow2.weblab.core.services.analyser.ProcessArgs args)
           
abstract  void process(org.ow2.weblab.core.model.Text text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.apache.commons.logging.Log logger
Constructor Detail

TextAnnotator

public TextAnnotator(org.apache.commons.logging.Log logger)
Method Detail

process

public org.ow2.weblab.core.services.analyser.ProcessReturn process(org.ow2.weblab.core.services.analyser.ProcessArgs args)
                                                            throws org.ow2.weblab.core.services.AccessDeniedException,
                                                                   org.ow2.weblab.core.services.ContentNotAvailableException,
                                                                   org.ow2.weblab.core.services.InsufficientResourcesException,
                                                                   org.ow2.weblab.core.services.InvalidParameterException,
                                                                   org.ow2.weblab.core.services.ServiceNotConfiguredException,
                                                                   org.ow2.weblab.core.services.UnexpectedException,
                                                                   org.ow2.weblab.core.services.UnsupportedRequestException
Specified by:
process in interface org.ow2.weblab.core.services.Analyser
Throws:
org.ow2.weblab.core.services.AccessDeniedException
org.ow2.weblab.core.services.ContentNotAvailableException
org.ow2.weblab.core.services.InsufficientResourcesException
org.ow2.weblab.core.services.InvalidParameterException
org.ow2.weblab.core.services.ServiceNotConfiguredException
org.ow2.weblab.core.services.UnexpectedException
org.ow2.weblab.core.services.UnsupportedRequestException

annote

public void annote(org.ow2.weblab.core.model.Text text,
                   int offset,
                   java.lang.String word,
                   java.lang.String className,
                   java.lang.String label,
                   boolean createAnnotation)
Create an annotation on a text based on element detected.

Parameters:
text - : the Text unit being annotated
offset - : the offset of the detected element
word - : the word being detected
className - : the class name of the detected object
label - : the canonical label to use
createAnnotation - : boolean option to force creation of Annotation for each new call or reuse the first Annotation on the Text.

process

public abstract void process(org.ow2.weblab.core.model.Text text)
                      throws org.ow2.weblab.core.services.AccessDeniedException,
                             org.ow2.weblab.core.services.ContentNotAvailableException,
                             org.ow2.weblab.core.services.InsufficientResourcesException,
                             org.ow2.weblab.core.services.InvalidParameterException,
                             org.ow2.weblab.core.services.ServiceNotConfiguredException,
                             org.ow2.weblab.core.services.UnexpectedException,
                             org.ow2.weblab.core.services.UnsupportedRequestException
Throws:
org.ow2.weblab.core.services.AccessDeniedException
org.ow2.weblab.core.services.ContentNotAvailableException
org.ow2.weblab.core.services.InsufficientResourcesException
org.ow2.weblab.core.services.InvalidParameterException
org.ow2.weblab.core.services.ServiceNotConfiguredException
org.ow2.weblab.core.services.UnexpectedException
org.ow2.weblab.core.services.UnsupportedRequestException

checkParameters

protected java.util.List<org.ow2.weblab.core.model.Text> checkParameters(org.ow2.weblab.core.services.analyser.ProcessArgs args)
                                                                  throws org.ow2.weblab.core.services.InvalidParameterException
Parameters:
args - The ProcessArgs
Returns:
The list of Text contained by the Resource in args.
Throws:
ProcessException - For any reason preventing the retrieval of text unit to be done.
org.ow2.weblab.core.services.InvalidParameterException


Copyright © 2004-2012. All Rights Reserved.