Question

I would like to use BWP Gazetteer instead of Default Gazetteer of GATE. For this, i added it as a resource in creole.xml and included its JAR as well in the workspace.

Creole.xml

  <RESOURCE>
<NAME>BWPGazetteer</NAME>
<JAR>BWPGazetteer.jar</JAR>
<CLASS>bwp.gate.gazetteer.BWPGazetteer</CLASS>
<COMMENT>A BWPGazetteer.</COMMENT>
  <PARAMETER NAME="document" RUNTIME="true"
    COMMENT="The document to be processed"> gate.Document</PARAMETER>
  <PARAMETER NAME="annotationSetName" RUNTIME="true"
    COMMENT="The annotation set to be used for the generated annotations"
    OPTIONAL="true">java.lang.String</PARAMETER>
  <PARAMETER NAME="listsURL"
    DEFAULT="resources/gazetteer/lists.def"
    COMMENT="The URL to the file with list of lists" SUFFIXES="def">
    java.net.URL</PARAMETER>
  <PARAMETER DEFAULT="UTF-8"
    COMMENT="The encoding used for reading the definitions" NAME="encoding">
    java.lang.String</PARAMETER>
  <PARAMETER DEFAULT="true"
    COMMENT="Should this gazetteer diferentiate on case"
    NAME="caseSensitive">java.lang.Boolean</PARAMETER>
  <PARAMETER DEFAULT="true"
    COMMENT="Should this gazetteer only match whole words"
    NAME="wholeWordsOnly">java.lang.Boolean</PARAMETER>
    <PARAMETER NAME="normalizedDistanceThreshold"
            COMMENT="Maximum normalized distance(0.0-1.0) for a match"
            DEFAULT="0.1">
            java.lang.Double
        </PARAMETER>
<PARAMETER DEFAULT="true"
    COMMENT="Should this gazetter avoid overlapping annotations"
    NAME= "avoidOverlapingAnnotations">
    java.lang.Boolean
</PARAMETER>

Can anyone tell me what further changes are required in my JAVA code or config files to use it?

Was it helpful?

Solution

You shouldn't need to modify any creole.xml files, you just download and unpack the BWPGazetteer distribution, load the BWPGazetteer directory as a CREOLE plugin, create an instance of the gazetteer and slot it into your pipeline in the appropriate place. By far the easiest approach to this is to use GATE Developer to build your pipeline (including the relevant gazetteer instance(s) in the right place(s)), then right click and "Export for GATECloud.net". This will produce a zip file containing a saved application state (application.xgapp) and all the plugins and resource files the application uses.

Unpack this zip file somewhere in your project and then you can simply use PersistenceManager.loadObjectFromFile (or loadObjectFromUrl) to load the saved application along with all the plugins it requires.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top