org.ow2.weblab.service.gate
Class GateService

java.lang.Object
  extended by org.ow2.weblab.service.gate.GateService
All Implemented Interfaces:
org.ow2.weblab.core.services.Analyser

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

This class is a WebService calling Gate with different configurations. It initialises gate once with a gapp configuration and implements a corpus pipeline. Most of the parameters are set in the converter.

Author:
khelif, ymombrun
See Also:
GateConverter

Field Summary
static java.lang.String CONVERTER_PROPERTY
          Name of the property that contains the class of the converter to be instantiated
static java.lang.String PROPERTIES_FILE_NAME
          Name of the property file to be loaded.
 
Constructor Summary
GateService()
           
GateService(java.io.File defaultGappFile)
           
GateService(java.io.File defaultGappFile, java.io.File pluginsPath)
           
GateService(java.io.File gateHomePath, java.io.File defaultGappFile, java.io.File pluginsPath, GateConverter converter)
           
GateService(java.io.File defaultGappFile, java.io.File pluginsPath, GateConverter converter)
           
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTIES_FILE_NAME

public static final java.lang.String PROPERTIES_FILE_NAME
Name of the property file to be loaded.

See Also:
Constant Field Values

CONVERTER_PROPERTY

public static final java.lang.String CONVERTER_PROPERTY
Name of the property that contains the class of the converter to be instantiated

See Also:
Constant Field Values
Constructor Detail

GateService

public GateService()
            throws java.io.IOException,
                   org.ow2.weblab.core.extended.exception.WebLabCheckedException
Throws:
java.io.IOException - If something fails with defaultGappFile or pluginsPath
org.ow2.weblab.core.extended.exception.WebLabCheckedException - If converter is null of if something fails in Gate internal initialisation

GateService

public GateService(java.io.File defaultGappFile)
            throws java.io.IOException,
                   org.ow2.weblab.core.extended.exception.WebLabCheckedException
Parameters:
defaultGappFile - The default Gapp file to be used
Throws:
java.io.IOException - If something fails with defaultGappFile or pluginsPath
org.ow2.weblab.core.extended.exception.WebLabCheckedException - If converter is null of if something fails in Gate internal initialisation

GateService

public GateService(java.io.File defaultGappFile,
                   java.io.File pluginsPath)
            throws java.io.IOException,
                   org.ow2.weblab.core.extended.exception.WebLabCheckedException
Parameters:
defaultGappFile - The default Gapp file to be used
pluginsPath - The path to the plugin repository
Throws:
java.io.IOException - If something fails with defaultGappFile or pluginsPath
org.ow2.weblab.core.extended.exception.WebLabCheckedException - If converter is null of if something fails in Gate internal initialisation

GateService

public GateService(java.io.File defaultGappFile,
                   java.io.File pluginsPath,
                   GateConverter converter)
            throws java.io.IOException,
                   org.ow2.weblab.core.extended.exception.WebLabCheckedException
Parameters:
defaultGappFile - The default Gapp file to be used
pluginsPath - The path to the plugin repository
converter - The GateConverter in charge of reading Gate documents and annotate WebLab texts
Throws:
java.io.IOException - If something fails with defaultGappFile or pluginsPath
org.ow2.weblab.core.extended.exception.WebLabCheckedException - If converter is null of if something fails in Gate internal initialisation

GateService

public GateService(java.io.File gateHomePath,
                   java.io.File defaultGappFile,
                   java.io.File pluginsPath,
                   GateConverter converter)
            throws java.io.IOException,
                   org.ow2.weblab.core.extended.exception.WebLabCheckedException
Parameters:
gateHomePath - The path to Gate home folder
defaultGappFile - The default Gapp file to be used
pluginsPath - The path to the plugin repository
converter - The GateConverter in charge of reading Gate documents and annotate WebLab texts
Throws:
java.io.IOException - If something fails with defaultGappFile or pluginsPath
org.ow2.weblab.core.extended.exception.WebLabCheckedException - If converter is null of if something fails in Gate internal initialisation
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.UnexpectedException,
                                                                   org.ow2.weblab.core.services.InvalidParameterException,
                                                                   org.ow2.weblab.core.services.InsufficientResourcesException
Specified by:
process in interface org.ow2.weblab.core.services.Analyser
Throws:
org.ow2.weblab.core.services.UnexpectedException
org.ow2.weblab.core.services.InvalidParameterException
org.ow2.weblab.core.services.InsufficientResourcesException

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.