1   /*
2    * Gazetteer.java
3    *
4    * Copyright (c) 2002, The University of Sheffield.
5    *
6    * This file is part of GATE (see http://gate.ac.uk/), and is free
7    * software, licenced under the GNU Library General Public License,
8    * Version 2, June1991.
9    *
10   * A copy of this licence is included in the distribution in the file
11   * licence.html, and is also available at http://gate.ac.uk/gate/licence.html.
12   *
13   * borislav popov 02/2002
14   *
15   */
16   package gate.creole.gazetteer;
17  
18  /**The Gazetteer interface defines the mandatory methods of a gazetteer PR. */
19  public interface Gazetteer extends gate.LanguageAnalyser,gate.ProcessingResource {
20  
21    /** Looks-up a string
22     * @param singleItem the string
23     * @return set of Lookups
24     */
25    public java.util.Set lookup(String singleItem);
26  
27    /**
28     * Sets the AnnotationSet that will be used at the next run for the newly
29     * produced annotations.
30     * @param newAnnotationSetName the annotation set name for
31     * the annotations that are going to be produced
32     */
33    public void setAnnotationSetName(String newAnnotationSetName);
34  
35    /**
36     * Gets the AnnotationSet that will be used at the next run for the newly
37     * produced annotations.
38     * @return the current AnnotationSet name
39     */
40    public String getAnnotationSetName() ;
41  
42    public void setEncoding(String newEncoding);
43  
44    public String getEncoding() ;
45  
46    /**Gets the url of the lists.def file
47     * @return the url of the lists.def file  */
48    public java.net.URL getListsURL() ;
49  
50    /**Sets the url of the lists.def file
51     * @param newListsURL the url of the lists.def file to be set  */
52    public void setListsURL(java.net.URL newListsURL) ;
53  
54    /**Triggers case sensitive
55     * @param newCaseSensitive turn on or off case sensitivity */
56    public void setCaseSensitive(Boolean newCaseSensitive) ;
57  
58    /**Gets the current case sensitivity
59     * @return the current case sensitivity */
60    public Boolean getCaseSensitive();
61  
62    /**Sets the mapping definition if such to this gazetteer
63     * @param mapping a mapping definition */
64    public void setMappingDefinition(MappingDefinition mapping);
65  
66    /**Gets the mapping definition of this gazetteer,if such
67     * @return the mapping definition of this gazetteer,if such otherwise null   */
68    public MappingDefinition getMappingDefinition();
69  
70    /**Gets the linear definition of this gazetteer. There is no parallel
71     * set method because the definition is laoded through the listsUrl
72     * on init().
73     * @return the linear definition of the gazetteer */
74    public LinearDefinition getLinearDefinition();
75  
76    /**
77     * Fires a Gazetteer Event
78     * @param ge Gazetteer Event to be fired
79     */
80    public void fireGazetteerEvent(GazetteerEvent ge) ;
81  
82    /**
83     * Registers a Gazetteer Listener
84     * @param gl Gazetteer Listener to be registered
85     */
86    public void addGazetteerListener(GazetteerListener gl);
87  
88    /**
89     * Adds a new string to the gazetteer
90     * @param singleItem
91     * @param lookup the lookup to be associated with the new string
92     * @return true if the operation was successful
93     */
94    boolean add(String singleItem, Lookup lookup);
95  
96    /**
97     * Removes a string from the gazetteer
98     * @param singleItem
99     * @return true if the operation was successful
100    */
101   boolean remove(String singleItem);
102 }//interface Gazetteer