public abstract class AbstractGazetteer extends AbstractLanguageAnalyser implements Gazetteer
AbstractProcessingResource.InternalStatusListener, AbstractProcessingResource.IntervalProgressListener
Modifier and Type | Field and Description |
---|---|
protected String |
annotationSetName
Used to store the annotation set currently being used for the newly
generated annotations
|
protected Boolean |
caseSensitive
Should this gazetteer be case sensitive.
|
protected LinearDefinition |
definition
the linear definition of the gazetteer
|
protected String |
encoding
the encoding of the gazetteer
|
protected Set<GazetteerListener> |
listeners
the set of gazetteer listeners
|
protected URL |
listsURL
The value of this property is the URL that will be used for reading the
lists that define this Gazetteer
|
protected Boolean |
longestMatchOnly
Should this gazetteer only match the longest string starting from any
offset?
|
protected MappingDefinition |
mappingDefinition
reference to mapping definition info
allows filling of Lookup.ontologyClass according to a list
|
protected Boolean |
wholeWordsOnly
Should this gazetteer only match whole words.
|
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 |
---|
AbstractGazetteer() |
Modifier and Type | Method and Description |
---|---|
void |
addGazetteerListener(GazetteerListener gl)
Registers a Gazetteer Listener
|
void |
fireGazetteerEvent(GazetteerEvent ge)
fires a Gazetteer Event
|
String |
getAnnotationSetName()
Gets the AnnotationSet that will be used at the next run for the newly
produced annotations.
|
Boolean |
getCaseSensitive()
Gets the current case sensitivity
|
String |
getEncoding() |
LinearDefinition |
getLinearDefinition()
Gets the linear definition of this gazetteer. there is no parallel
set method because the definition is loaded through the listsUrl
on init().
|
URL |
getListsURL()
Gets the url of the lists.def file
|
Boolean |
getLongestMatchOnly() |
MappingDefinition |
getMappingDefinition()
Gets the mapping definition of this gazetteer,if such
|
Boolean |
getWholeWordsOnly()
Gets the value for the
wholeWordsOnly parameter. |
void |
reInit()
Reinitialises the processing resource.
|
void |
setAnnotationSetName(String newAnnotationSetName)
Sets the AnnotationSet that will be used at the next run for the newly
produced annotations.
|
void |
setCaseSensitive(Boolean newCaseSensitive)
Triggers case sensitive
|
void |
setEncoding(String newEncoding) |
void |
setListsURL(URL newListsURL)
Sets the url of the lists.def file
|
void |
setLongestMatchOnly(Boolean longestMatchOnly) |
void |
setMappingDefinition(MappingDefinition mapping)
Sets the mapping definition if such to this gazetteer
|
void |
setWholeWordsOnly(Boolean wholeWordsOnly)
Sets the value for the
wholeWordsOnly parameter. |
getCorpus, getDocument, setCorpus, setDocument
addProgressListener, addStatusListener, cleanup, execute, fireProcessFinished, fireProgressChanged, fireStatusChanged, getRuntimeParameterValues, getRuntimeParameterValues, init, interrupt, isInterrupted, 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
getCorpus, getDocument, setCorpus, setDocument
cleanup, getParameterValue, init, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
execute, interrupt, isInterrupted
protected Set<GazetteerListener> listeners
protected String annotationSetName
protected URL listsURL
protected Boolean caseSensitive
protected Boolean wholeWordsOnly
protected Boolean longestMatchOnly
protected LinearDefinition definition
protected MappingDefinition mappingDefinition
public AbstractGazetteer()
@RunTime @Optional @CreoleParameter(comment="The annotation set to be used for the generated annotations") public void setAnnotationSetName(String newAnnotationSetName)
setAnnotationSetName
in interface Gazetteer
newAnnotationSetName
- the annotation set name for
the annotations that are going to be producedpublic String getAnnotationSetName()
getAnnotationSetName
in interface Gazetteer
@CreoleParameter(comment="The encoding used for reading the definitions", defaultValue="UTF-8") public void setEncoding(String newEncoding)
setEncoding
in interface Gazetteer
public String getEncoding()
getEncoding
in interface Gazetteer
public URL getListsURL()
Gazetteer
getListsURL
in interface Gazetteer
@CreoleParameter(comment="The URL to the file with list of lists", suffixes="def", defaultValue="resources/gazetteer/lists.def") public void setListsURL(URL newListsURL)
Gazetteer
setListsURL
in interface Gazetteer
newListsURL
- the url of the lists.def file to be set@CreoleParameter(comment="Should this gazetteer diferentiate on case?", defaultValue="true") public void setCaseSensitive(Boolean newCaseSensitive)
Gazetteer
setCaseSensitive
in interface Gazetteer
newCaseSensitive
- turn on or off case sensitivitypublic Boolean getCaseSensitive()
Gazetteer
getCaseSensitive
in interface Gazetteer
public void setMappingDefinition(MappingDefinition mapping)
Gazetteer
setMappingDefinition
in interface Gazetteer
mapping
- a mapping definitionpublic MappingDefinition getMappingDefinition()
Gazetteer
getMappingDefinition
in interface Gazetteer
public Boolean getLongestMatchOnly()
@RunTime @CreoleParameter(comment="Should this gazetteer only match the longest string starting from any offset?", defaultValue="true") public void setLongestMatchOnly(Boolean longestMatchOnly)
longestMatchOnly
- the longestMatchOnly to setpublic LinearDefinition getLinearDefinition()
getLinearDefinition
in interface Gazetteer
public void reInit() throws ResourceInstantiationException
AbstractProcessingResource
AbstractProcessingResource.init()
. This
functionality must be overriden by derived classes as necessary.reInit
in interface ProcessingResource
reInit
in class AbstractProcessingResource
ResourceInstantiationException
public void fireGazetteerEvent(GazetteerEvent ge)
fireGazetteerEvent
in interface Gazetteer
ge
- Gazetteer Event to be firedpublic void addGazetteerListener(GazetteerListener gl)
addGazetteerListener
in interface Gazetteer
gl
- Gazetteer Listener to be registeredpublic Boolean getWholeWordsOnly()
wholeWordsOnly
parameter.@RunTime @CreoleParameter(comment="Should this gazetteer only match whole words?", defaultValue="true") public void setWholeWordsOnly(Boolean wholeWordsOnly)
wholeWordsOnly
parameter.wholeWordsOnly
- a Boolean value.