gate.creole
Class Transducer
java.lang.Object
|
+--gate.util.AbstractFeatureBearer
|
+--gate.creole.AbstractResource
|
+--gate.creole.AbstractProcessingResource
|
+--gate.creole.AbstractLanguageAnalyser
|
+--gate.creole.Transducer
- All Implemented Interfaces:
- ANNIEConstants, Executable, FeatureBearer, LanguageAnalyser, NameBearer, ProcessingResource, Resource, Serializable
- Direct Known Subclasses:
- ANNIETransducer, OntologyAwareTransducer, VPChunker
- public class Transducer
- extends AbstractLanguageAnalyser
A cascaded multi-phase transducer using the Jape language which is a
variant of the CPSL language.
- See Also:
- Serialized Form
Fields inherited from interface gate.creole.ANNIEConstants |
ANNOTATION_COREF_FEATURE_NAME, DATE_ANNOTATION_TYPE, DOCUMENT_COREF_FEATURE_NAME, LOCATION_ANNOTATION_TYPE, LOOKUP_ANNOTATION_TYPE, LOOKUP_CLASS_FEATURE_NAME, LOOKUP_MAJOR_TYPE_FEATURE_NAME, LOOKUP_MINOR_TYPE_FEATURE_NAME, LOOKUP_ONTOLOGY_FEATURE_NAME, MONEY_ANNOTATION_TYPE, ORGANIZATION_ANNOTATION_TYPE, PERSON_ANNOTATION_TYPE, PERSON_GENDER_FEATURE_NAME, PR_NAMES, SENTENCE_ANNOTATION_TYPE, SPACE_TOKEN_ANNOTATION_TYPE, TOKEN_ANNOTATION_TYPE, TOKEN_CATEGORY_FEATURE_NAME, TOKEN_KIND_FEATURE_NAME, TOKEN_LENGTH_FEATURE_NAME, TOKEN_ORTH_FEATURE_NAME, TOKEN_STRING_FEATURE_NAME |
Constructor Summary |
Transducer()
Default constructor. |
Methods inherited from class gate.creole.AbstractResource |
checkParameterValues, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
TRANSD_DOCUMENT_PARAMETER_NAME
public static final String TRANSD_DOCUMENT_PARAMETER_NAME
TRANSD_INPUT_AS_PARAMETER_NAME
public static final String TRANSD_INPUT_AS_PARAMETER_NAME
TRANSD_OUTPUT_AS_PARAMETER_NAME
public static final String TRANSD_OUTPUT_AS_PARAMETER_NAME
TRANSD_ENCODING_PARAMETER_NAME
public static final String TRANSD_ENCODING_PARAMETER_NAME
TRANSD_GRAMMAR_URL_PARAMETER_NAME
public static final String TRANSD_GRAMMAR_URL_PARAMETER_NAME
Transducer
public Transducer()
- Default constructor. Does nothing apart from calling the default
constructor from the super class. The actual object initialisation is done
via the
init()
method.
init
public Resource init()
throws ResourceInstantiationException
- This method is the one responsible for initialising the transducer. It
assumes that all the needed parameters have been already set using the
appropiate setXXX() methods.
- Overrides:
init
in class AbstractProcessingResource
- Returns:
- a reference to this
execute
public void execute()
throws ExecutionException
- Implementation of the run() method from
Runnable
.
This method is responsible for doing all the processing of the input
document.
- Overrides:
execute
in class AbstractProcessingResource
interrupt
public void interrupt()
- Notifies all the PRs in this controller that they should stop their
execution as soon as possible.
- Overrides:
interrupt
in class AbstractProcessingResource
setGrammarURL
public void setGrammarURL(URL newGrammarURL)
- Sets the grammar to be used for building this transducer.
- Parameters:
newGrammarURL
- an URL to a file containing a Jape grammar.
getGrammarURL
public URL getGrammarURL()
- Gets the URL to the grammar used to build this transducer.
- Returns:
- a
URL
pointing to the grammar file.
setEncoding
public void setEncoding(String newEncoding)
- Sets the encoding to be used for reding the input file(s) forming the Jape
grammar. Note that if the input grammar is a multi-file one than the same
encoding will be used for reding all the files. Multi file grammars with
different encoding across the composing files are not supported!
- Parameters:
newEncoding
- a {link String} representing the encoding.
getEncoding
public String getEncoding()
- Gets the encoding used for reding the grammar file(s).
setInputASName
public void setInputASName(String newInputASName)
- Sets the
AnnotationSet
to be used as input for the transducer.
- Parameters:
newInputAS
- a AnnotationSet
getInputASName
public String getInputASName()
- Gets the
AnnotationSet
used as input by this transducer.
- Returns:
- a
AnnotationSet
setOutputASName
public void setOutputASName(String newOutputASName)
- Sets the
AnnotationSet
to be used as output by the transducer.
- Parameters:
newOutputAS
- a AnnotationSet
getOutputASName
public String getOutputASName()
- Gets the
AnnotationSet
used as output by this transducer.
- Returns:
- a
AnnotationSet