@CreoleResource(name="GATE Morphological analyser", helpURL="http://gate.ac.uk/userguide/sec:parsers:morpher", comment="Morphological Analyzer for the English Language") public class Morph extends AbstractLanguageAnalyser implements ProcessingResource, CustomDuplication
Interpret
,
the Morphological Analyzer.AbstractProcessingResource.InternalStatusListener, AbstractProcessingResource.IntervalProgressListener
Modifier and Type | Field and Description |
---|---|
protected String |
affixFeatureName
Feature Name that should be displayed for the affix
|
protected String |
annotationSetName
The name of the annotation set used for input
|
protected Boolean |
caseSensitive
Boolean value that tells if parser should behave in caseSensitive mode
|
protected Boolean |
considerPOSTag |
protected Interpret |
existingInterpret
If this Morph PR is a duplicate of an existing PR, this property
will hold a reference to the original PR's Interpret instance.
|
protected Boolean |
failOnMissingInputAnnotations |
protected Interpret |
interpret
Instance of BaseWord class - English Morpher
|
protected org.apache.log4j.Logger |
logger |
protected String |
rootFeatureName
Feature Name that should be displayed for the root word
|
protected URL |
rulesFile
File which contains rules to be processed
|
corpus, document
interrupted
name
features
ANNOTATION_COREF_FEATURE_NAME, DATE_ANNOTATION_TYPE, DATE_POSTED_ANNOTATION_TYPE, DEFAULT_FILE, DOCUMENT_COREF_FEATURE_NAME, JOB_ID_ANNOTATION_TYPE, LOCATION_ANNOTATION_TYPE, LOOKUP_ANNOTATION_TYPE, LOOKUP_CLASS_FEATURE_NAME, LOOKUP_INSTANCE_FEATURE_NAME, LOOKUP_LANGUAGE_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, PLUGIN_DIR, 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 and Description |
---|
Morph()
Default Constructor
|
Modifier and Type | Method and Description |
---|---|
Resource |
duplicate(Factory.DuplicationContext ctx)
Duplicate this morpher, sharing the compiled regular expression
patterns and finite state machine with the duplicate.
|
void |
execute()
Method is executed after the init() method has finished its execution.
|
String |
findAffix(String word,
String cat)
This method should only be called after init()
|
String |
findBaseWord(String word,
String cat)
This method should only be called after init()
|
String |
getAffixFeatureName()
Returns the feature name that has been currently set to display the affix
word
|
String |
getAnnotationSetName()
Returns the name of the AnnotationSet that has been provided to create
the AnnotationSet
|
Boolean |
getCaseSensitive()
A method which returns if the parser is in caseSenstive mode
|
Boolean |
getConsiderPOSTag() |
Boolean |
getFailOnMissingInputAnnotations() |
String |
getRootFeatureName()
Returns the feature name that has been currently set to display the root
word
|
URL |
getRulesFile()
Returns the document under process
|
Resource |
init()
This method creates the instance of the BaseWord - English Morpher and
returns the instance of current class with different attributes and
the instance of BaseWord class wrapped into it.
|
void |
setAffixFeatureName(String affixFeatureName)
Sets the feature name that should be displayed for the affix
|
void |
setAnnotationSetName(String annotationSetName)
Sets the AnnonationSet name, that is used to create the AnnotationSet
|
void |
setCaseSensitive(Boolean value)
Sets the caseSensitive value, that is used to tell parser if it should
convert document to lowercase before parsing
|
void |
setConsiderPOSTag(Boolean value) |
void |
setExistingInterpret(Interpret existingInterpret)
Only for use by the duplication mechanism.
|
void |
setFailOnMissingInputAnnotations(Boolean fail) |
void |
setRootFeatureName(String rootFeatureName)
Sets the feature name that should be displayed for the root word
|
void |
setRulesFile(URL rulesFile)
Sets the rule file to be processed
|
getCorpus, getDocument, setCorpus, setDocument
addProgressListener, addStatusListener, cleanup, fireProcessFinished, fireProgressChanged, fireStatusChanged, getRuntimeParameterValues, getRuntimeParameterValues, interrupt, isInterrupted, reInit, removeProgressListener, removeStatusListener
checkParameterValues, flushBeanInfoCache, forgetBeanInfo, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners, toString
getFeatures, setFeatures
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
reInit
cleanup, getParameterValue, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
interrupt, isInterrupted
protected String rootFeatureName
protected String affixFeatureName
protected String annotationSetName
protected Boolean caseSensitive
protected Boolean considerPOSTag
protected Interpret existingInterpret
protected Boolean failOnMissingInputAnnotations
protected org.apache.log4j.Logger logger
public Morph()
@RunTime @Optional @CreoleParameter(comment="Throw and exception when there are none of the required input annotations", defaultValue="true") public void setFailOnMissingInputAnnotations(Boolean fail)
public Boolean getFailOnMissingInputAnnotations()
public Resource init() throws ResourceInstantiationException
init
in interface Resource
init
in class AbstractProcessingResource
ResourceInstantiationException
public void execute() throws ExecutionException
execute
in interface Executable
execute
in class AbstractProcessingResource
ExecutionException
public String findBaseWord(String word, String cat)
word
- public String findAffix(String word, String cat)
word
- public void setRulesFile(URL rulesFile)
rulesFile
- - rule File name to be processedpublic URL getRulesFile()
public String getRootFeatureName()
public void setRootFeatureName(String rootFeatureName)
rootFeatureName
- public String getAffixFeatureName()
public void setAffixFeatureName(String affixFeatureName)
affixFeatureName
- public String getAnnotationSetName()
public void setAnnotationSetName(String annotationSetName)
annotationSetName
- public Boolean getCaseSensitive()
Boolean
value.public void setCaseSensitive(Boolean value)
public Boolean getConsiderPOSTag()
public void setConsiderPOSTag(Boolean value)
public void setExistingInterpret(Interpret existingInterpret)
public Resource duplicate(Factory.DuplicationContext ctx) throws ResourceInstantiationException
duplicate
in interface CustomDuplication
ctx
- the current duplication context
.
If an implementation of this method needs to duplicate any
other resources as part of the custom duplication process
it should pass this context back to the two-argument form of
Factory.duplicate
rather than using the single-argument form.ResourceInstantiationException