%% Modifying the Gazetteer

\section{Introduction}
The gazetteer consists of a set of lists containing names of things
such as cities, organisations, days of the week, etc. These lists are
typically used to assist with the task of named entity recognition,
although they may be used for any purpose. When the gazetteer is run
on a document, annotations of type Lookup will be created for each
matching string in the text. The gazetteer does not depend on Tokens
or on any other annotation. This means that an entry may span more
than one token. A Lookup annotation will only be created if the entire
entry is matched. Partial entries are not matched. An entry does not
have to correspond with a Token annotation to match, but it must be
delimited by white space or punctuation.

Each list is a plain text file, with one entry per line. 

Below is a section of the list for units of currency: 
\begin{verbatim}
 Ecu  
 European Currency Units  
 FFr  
 Fr  
 German mark  
 German marks  
 New Taiwan dollar  
 New Taiwan dollars  
 NT dollar  
 NT dollars 
\end{verbatim}

An index file (usually called lists.def) is used to access these
lists. Each gazetteer list should reside in the same directory as the
index file. For each list, a major type must be specified and, optionally,
a minor type. In the example below, the first column refers to the
list name, the second column to the major type, and the third to the
minor type. These lists are compiled into finite state machines. Any
text strings matched by these machines will be annotated with features
specifying the major and minor types. 

\begin{verbatim}
currency_prefix.lst:currency_unit:pre_amount
currency_unit.lst:currency_unit:post_amount 
date.lst:date:specific_date
day.lst:date:day
month.lst:date:month
season.lst:date:season
\end{verbatim}

Grammar rules can specify the types to be identified in particular
circumstances. The major and minor types enable this identification to
take place, by giving access to items stored in particular lists or
combinations of lists.

For example, if a day needs to be identified, the minor
type "day" would be specified in the grammar, in order to match only
information about specific days. If any kind of date needs to be
identified, the major type "date" would be specified. This might
include weeks, months, years etc. as well as days of the week, and
would give access to all the items stored in day.lst, month.lst, season.lst,
and date.lst in the example shown.

\section{Creating and Modifying Gazetteer Lists}

Gazetteer lists can be modified using any text editor. Use of the GATE
Unicode editor is advised, however, in order to ensure that the lists are stored
as UTF-8, which will minimise any language encoding problems,
particulary if e.g. accents are present.

To create a new list, simply add an entry for that list to the
definitions file and add the new list in the same directory as the
existing lists. 

After any modifications have been made, ensure that you reinitalise the
gazetteer PR in GATE, if one is already loaded, before rerunning your
application.

\section{Using Gaze}
There is also a gazetteer viewer and editor available within GATE, if
the correct creole resource is present. If it is available, double
clicking on the gazetteer list from the resource tree will display the
contents of the gazetteer in the main window. The first pane will
display the definition file, while the right pane will display
whichever gazetteer list has been selected from it.

A gazetteer list can be modified simply by typing in it. it can be
saved by clicking the Save button. When a list is saved, the whole
gazetteer is automatically reinitialised (and will be ready for use in
GATE immediately).

To edit the definition file, right click inside the pane and choose
from the options (Inset, Edit, Remove). A pop-up menu will appear to
guide you through the remaining process. Save the definition file byu
selecting Save. Again, the gazetteer will be reinitialised
automatically.




