001 /*
002 * Gazetteer.java
003 *
004 * Copyright (c) 2002, The University of Sheffield.
005 *
006 * This file is part of GATE (see http://gate.ac.uk/), and is free
007 * software, licenced under the GNU Library General Public License,
008 * Version 2, June1991.
009 *
010 * A copy of this licence is included in the distribution in the file
011 * licence.html, and is also available at http://gate.ac.uk/gate/licence.html.
012 *
013 * borislav popov 02/2002
014 *
015 */
016 package gate.creole.gazetteer;
017
018 /**The Gazetteer interface defines the mandatory methods of a gazetteer PR. */
019 public interface Gazetteer extends gate.LanguageAnalyser,gate.ProcessingResource {
020
021 /** Looks-up a string
022 * @param singleItem the string
023 * @return set of Lookups
024 */
025 public java.util.Set lookup(String singleItem);
026
027 /**
028 * Sets the AnnotationSet that will be used at the next run for the newly
029 * produced annotations.
030 * @param newAnnotationSetName the annotation set name for
031 * the annotations that are going to be produced
032 */
033 public void setAnnotationSetName(String newAnnotationSetName);
034
035 /**
036 * Gets the AnnotationSet that will be used at the next run for the newly
037 * produced annotations.
038 * @return the current AnnotationSet name
039 */
040 public String getAnnotationSetName() ;
041
042 public void setEncoding(String newEncoding);
043
044 public String getEncoding() ;
045
046 /**Gets the url of the lists.def file
047 * @return the url of the lists.def file */
048 public java.net.URL getListsURL() ;
049
050 /**Sets the url of the lists.def file
051 * @param newListsURL the url of the lists.def file to be set */
052 public void setListsURL(java.net.URL newListsURL) ;
053
054 /**Triggers case sensitive
055 * @param newCaseSensitive turn on or off case sensitivity */
056 public void setCaseSensitive(Boolean newCaseSensitive) ;
057
058 /**Gets the current case sensitivity
059 * @return the current case sensitivity */
060 public Boolean getCaseSensitive();
061
062 /**Sets the mapping definition if such to this gazetteer
063 * @param mapping a mapping definition */
064 public void setMappingDefinition(MappingDefinition mapping);
065
066 /**Gets the mapping definition of this gazetteer,if such
067 * @return the mapping definition of this gazetteer,if such otherwise null */
068 public MappingDefinition getMappingDefinition();
069
070 /**Gets the linear definition of this gazetteer. There is no parallel
071 * set method because the definition is laoded through the listsUrl
072 * on init().
073 * @return the linear definition of the gazetteer */
074 public LinearDefinition getLinearDefinition();
075
076 /**
077 * Fires a Gazetteer Event
078 * @param ge Gazetteer Event to be fired
079 */
080 public void fireGazetteerEvent(GazetteerEvent ge) ;
081
082 /**
083 * Registers a Gazetteer Listener
084 * @param gl Gazetteer Listener to be registered
085 */
086 public void addGazetteerListener(GazetteerListener gl);
087
088 /**
089 * Adds a new string to the gazetteer
090 * @param singleItem
091 * @param lookup the lookup to be associated with the new string
092 * @return true if the operation was successful
093 */
094 boolean add(String singleItem, Lookup lookup);
095
096 /**
097 * Removes a string from the gazetteer
098 * @param singleItem
099 * @return true if the operation was successful
100 */
101 boolean remove(String singleItem);
102 }//interface Gazetteer
|