public class FlexibleGazetteer extends AbstractLanguageAnalyser implements ProcessingResource
Title: Flexible Gazetteer
The Flexible Gazetteer provides users with the flexibility to choose their own customised input and an external Gazetteer. For example, the user might want to replace words in the text with their base forms (which is an output of the Morphological Analyser).
The Flexible Gazetteer performs lookup over a document based on the values of an arbitrary feature of an arbitrary annotation type, by using an externally provided gazetteer. It is important to use an external gazetteer as this allows the use of any type of gazetteer (e.g. an Ontological gazetteer).
AbstractProcessingResource.InternalStatusListener, AbstractProcessingResource.IntervalProgressListener
corpus
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 |
---|
FlexibleGazetteer() |
Modifier and Type | Method and Description |
---|---|
void |
execute()
This method runs the gazetteer.
|
Document |
getDocument()
Returns the document set up by user to work on
|
Gazetteer |
getGazetteerInst() |
String |
getInputASName()
Returns the inputAnnotationSetName
|
List<String> |
getInputFeatureNames()
Returns the feature names that are provided by the user to use their values
to replace their actual strings in the document
|
String |
getOutputASName()
Returns the outputAnnotationSetName
|
Resource |
init()
Does the actual loading and parsing of the lists.
|
void |
setDocument(Document doc)
Sets the document to work on
|
void |
setGazetteerInst(Gazetteer gazetteerInst) |
void |
setInputASName(String inputASName)
sets the input AnnotationSet Name
|
void |
setInputFeatureNames(List<String> inputs)
Feature names for example: Token.string, Token.root etc...
|
void |
setOutputASName(String outputASName)
Sets the name of annotation set that should be used for storing new
annotations
|
getCorpus, setCorpus
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
public FlexibleGazetteer()
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 void setDocument(Document doc)
setDocument
in interface LanguageAnalyser
setDocument
in class AbstractLanguageAnalyser
doc
- public Document getDocument()
getDocument
in interface LanguageAnalyser
getDocument
in class AbstractLanguageAnalyser
Document
public void setOutputASName(String outputASName)
outputASName
- public String getOutputASName()
String
value.public void setInputASName(String inputASName)
inputASName
- public String getInputASName()
String
value.public void setInputFeatureNames(List<String> inputs)
inputs
- public List<String> getInputFeatureNames()
List
value.public Gazetteer getGazetteerInst()
public void setGazetteerInst(Gazetteer gazetteerInst)