org.ow2.weblab.service.gate.converter
Class GateToWebLab

java.lang.Object
  extended by org.ow2.weblab.service.gate.converter.GateToWebLab
All Implemented Interfaces:
GateConverter

public class GateToWebLab
extends java.lang.Object
implements GateConverter

This class is the basic implementation GateConverter. It enables the creation of simple (and sometimes stupid) instances of NamedEntities in each Text section of the input WebLab Resource. At initialisation, it loads some properties from the file PROPERTIES_FILE_NAME:

Author:
ymombrun
Date:
2010-08-27

Field Summary
static java.lang.String INCLUDE_FEATURES_PROPERTY
          Name of the property that defines whether or not to include features in addition to annotation type.
static java.lang.String INCLUDE_IDS_PROPERTY
          Name of the property that defines whether or not to include id's properties in output annotations.
static java.lang.String MAX_ANNOTS_PROPERTY
          Name of the property that contains the max number of annotation to be extracted on a single MediaUnit.
static java.lang.String PROPERTIES_FILE_NAME
          Name of the property file to be loaded.
static java.lang.String SERVICE_URI_PROPERTY
          Name of the property that contains the URI of the service to be used if the created annotation shall contains a isProducedBy statement.
static java.lang.String SKIPPED_ANNOTATIONS_PROPERTY
          Name of the property that contains the list of properties to be excluded from the conversion.
static java.lang.String SKIPPED_FEATURES_PROPERTY
          Name of the property that contains the list of features to be excluded from the conversion.
 
Constructor Summary
GateToWebLab()
          The default constructors Reads PROPERTIES_FILE_NAME to set every internal properties.
 
Method Summary
 void convertInformation(gate.Corpus corpusGate, org.ow2.weblab.core.model.Resource resource, java.util.Map<gate.Document,org.ow2.weblab.core.model.Text> gateDocsAndText)
          This is the only method of the interface.
 void setServiceURI(java.lang.String serviceURI)
           
 
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

SKIPPED_ANNOTATIONS_PROPERTY

public static final java.lang.String SKIPPED_ANNOTATIONS_PROPERTY
Name of the property that contains the list of properties to be excluded from the conversion. Typically it contains SpaceToken, Token... and every other Gate Annotation that will not be used further in WebLab document.

See Also:
Constant Field Values

SKIPPED_FEATURES_PROPERTY

public static final java.lang.String SKIPPED_FEATURES_PROPERTY
Name of the property that contains the list of features to be excluded from the conversion. Typically it contains rules, matches... and every other Gate Annotation that will not be used further in WebLab document.

See Also:
Constant Field Values

SERVICE_URI_PROPERTY

public static final java.lang.String SERVICE_URI_PROPERTY
Name of the property that contains the URI of the service to be used if the created annotation shall contains a isProducedBy statement.

See Also:
Constant Field Values

MAX_ANNOTS_PROPERTY

public static final java.lang.String MAX_ANNOTS_PROPERTY
Name of the property that contains the max number of annotation to be extracted on a single MediaUnit.

See Also:
Constant Field Values

INCLUDE_FEATURES_PROPERTY

public static final java.lang.String INCLUDE_FEATURES_PROPERTY
Name of the property that defines whether or not to include features in addition to annotation type.

See Also:
Constant Field Values

INCLUDE_IDS_PROPERTY

public static final java.lang.String INCLUDE_IDS_PROPERTY
Name of the property that defines whether or not to include id's properties in output annotations.

See Also:
Constant Field Values
Constructor Detail

GateToWebLab

public GateToWebLab()
The default constructors Reads PROPERTIES_FILE_NAME to set every internal properties.

Method Detail

convertInformation

public void convertInformation(gate.Corpus corpusGate,
                               org.ow2.weblab.core.model.Resource resource,
                               java.util.Map<gate.Document,org.ow2.weblab.core.model.Text> gateDocsAndText)
Description copied from interface: GateConverter
This is the only method of the interface. It has to iterate on the entries in the Map to pass information from the key to the value.

Specified by:
convertInformation in interface GateConverter
Parameters:
corpusGate - A Gate Corpus that has been processed by the controller.
resource - The top level Resource. May be used to annotate it, or not.
gateDocsAndText - A map that associate to every gate.Document in the Corpus a WebLab Text to whom pass the annotation.

setServiceURI

public void setServiceURI(java.lang.String serviceURI)
Specified by:
setServiceURI in interface GateConverter
Parameters:
serviceURI - The URI of the service to be added in each annotation created.


Copyright © 2004-2012. All Rights Reserved.