Revision: 15107
http://gate.svn.sourceforge.net/gate/?rev=15107&view=rev
Author: nirajaswani
Date: 2012-01-18 14:12:41 +0000 (Wed, 18 Jan 2012)
Log Message:
-----------
parameter name corrected to match the actual parameter used in the constructor
Modified Paths:
--------------
gate/trunk/src/gate/creole/gazetteer/Lookup.java
Modified: gate/trunk/src/gate/creole/gazetteer/Lookup.java
===================================================================
--- gate/trunk/src/gate/creole/gazetteer/Lookup.java 2012-01-18 13:42:55 UTC
(rev 15106)
+++ gate/trunk/src/gate/creole/gazetteer/Lookup.java 2012-01-18 14:12:41 UTC
(rev 15107)
@@ -1,23 +1,22 @@
/*
- * Lookup.java
- *
- * Copyright (c) 1995-2010, The University of Sheffield. See the file
- * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
- *
- * This file is part of GATE (see http://gate.ac.uk/), and is free
- * software, licenced under the GNU Library General Public License,
- * Version 2, June 1991 (in the distribution as file licence.html,
- * and also available at http://gate.ac.uk/gate/licence.html).
- *
- * Valentin Tablan, 11/07/2000
- * borislav popov, 05/02/2002
- *
- * $Id$
+ * Lookup.java
+ *
+ * Copyright (c) 1995-2010, The University of Sheffield. See the file
+ * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
+ *
+ * This file is part of GATE (see http://gate.ac.uk/), and is free software,
+ * licenced under the GNU Library General Public License, Version 2, June 1991
+ * (in the distribution as file licence.html, and also available at
+ * http://gate.ac.uk/gate/licence.html).
+ *
+ * Valentin Tablan, 11/07/2000 borislav popov, 05/02/2002
+ *
+ * $Id$
*/
-
package gate.creole.gazetteer;
import gate.creole.ANNIEConstants;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -27,140 +26,149 @@
/**
* Used to describe a type of lookup annotations. A lookup is described by a
* major type a minor type and a list of languages. Added members are :
- * ontologyClass and list.
- * All these values are strings (the list of languages is a string and it is
- * intended to represesnt a comma separated list).
- *
- * An optional features field stores arbitary features as part of the lookup
+ * ontologyClass and list. All these values are strings (the list of languages
+ * is a string and it is intended to represesnt a comma separated list). An
+ * optional features field stores arbitary features as part of the lookup
* annotation. This can be used to set meta-data for a gazetteer entry.
*/
public class Lookup implements java.io.Serializable {
-
- /** Debug flag
+ /**
+ * Debug flag
*/
private static final boolean DEBUG = false;
-
+
/** a map of arbitary features */
public Map features = null;
-
+
/**
* Creates a new Lookup value with the given major and minor types and
* languages.
- *
- * @param major major type
- * @param minor minor type
- * @param theLanguages the languages
+ *
+ * @param major
+ * major type
+ * @param minor
+ * minor type
+ * @param theLanguages
+ * the languages
* @param annotationType
+ * the annotation type to use for annotating this particular lookup.
*/
- public Lookup(String theList, String major, String minor, String
theLanguages,String annType){
+ public Lookup(String theList, String major, String minor,
+ String theLanguages, String annotationType) {
majorType = major;
minorType = minor;
languages = theLanguages;
list = theList;
- annotationType = annType;
+ this.annotationType = annotationType;
}
+
/**
* Creates a new Lookup value with the given major and minor types and
* languages.
- *
- * @param major major type
- * @param minor minor type
- * @param theLanguages the languages
+ *
+ * @param major
+ * major type
+ * @param minor
+ * minor type
+ * @param theLanguages
+ * the languages
*/
- public Lookup(String theList, String major, String minor, String
theLanguages){
-
this(theList,major,minor,theLanguages,ANNIEConstants.LOOKUP_ANNOTATION_TYPE);
+ public Lookup(String theList, String major, String minor, String
theLanguages) {
+ this(theList, major, minor, theLanguages,
+ ANNIEConstants.LOOKUP_ANNOTATION_TYPE);
}
/** Tha major type for this lookup, e.g. "Organisation" */
public String majorType;
- /** The minor type for this lookup, e.g. "Company" */
+ /** The minor type for this lookup, e.g. "Company" */
public String minorType;
/** The languages for this lookup, e.g. "English, French" */
public String languages;
- /** the ontology class of this lookup according to the mapping between
- * list and ontology */
+ /**
+ * the ontology class of this lookup according to the mapping between list
and
+ * ontology
+ */
public String oClass;
- /** the ontology ID */
+ /** the ontology ID */
public String ontology;
- /** the list represented by this lookup*/
+ /** the list represented by this lookup */
public String list;
-
- /** annotation type that should be used to create a lookup*/
+
+ /** annotation type that should be used to create a lookup */
public String annotationType;
- /**Returns a string representation of this lookup in the format
- * This method is used in equals()
- * that caused this method to implement dualistic behaviour :
- * i.e. whenever class and ontology are filled then use the
- * long version,incl. list, ontology and class;
- * else return just majorType.minorType */
- public String toString(){
+ /**
+ * Returns a string representation of this lookup in the format This method
is
+ * used in equals() that caused this method to implement dualistic behaviour
:
+ * i.e. whenever class and ontology are filled then use the long
version,incl.
+ * list, ontology and class; else return just majorType.minorType
+ */
+ public String toString() {
StringBuffer b = new StringBuffer();
boolean longVersion = false;
boolean hasArbitaryFeatures = false;
- if (null!=ontology && null!=oClass){
+ if(null != ontology && null != oClass) {
longVersion = true;
}
-
if(null != features) {
hasArbitaryFeatures = true;
}
-
- if ( longVersion ) {
+ if(longVersion) {
b.append(list);
b.append(".");
}
b.append(majorType);
b.append(".");
- if (null != minorType) {
+ if(null != minorType) {
b.append(minorType);
- if (null!= languages) {
+ if(null != languages) {
b.append(".");
b.append(languages);
- }//if
- }//if
- if (longVersion) {
+ }// if
+ }// if
+ if(longVersion) {
b.append("|");
b.append(ontology);
b.append(":");
b.append(oClass);
}
-
if(hasArbitaryFeatures) {
- // as the ordering of the featureMap is undefined, create a new list of
+ // as the ordering of the featureMap is undefined, create a new list of
// keys and sort it to ensure the string returned is always the same
- List sortedKeys = new ArrayList(features.keySet());
+ List sortedKeys = new ArrayList(features.keySet());
Collections.sort(sortedKeys);
-
- for(Iterator it = sortedKeys.iterator(); it.hasNext(); ) {
+ for(Iterator it = sortedKeys.iterator(); it.hasNext();) {
String key = (String)it.next();
b.append("|");
b.append(key);
b.append(":");
b.append(features.get(key).toString());
-
}
}
return b.toString();
}
/**
- * Two lookups are equal if they have the same string representation
- * (major type and minor type).
+ * Two lookups are equal if they have the same string representation (major
+ * type and minor type).
+ *
* @param obj
*/
- public boolean equals(Object obj){
- if(obj instanceof Lookup) return obj.toString().equals(toString());
+ public boolean equals(Object obj) {
+ if(obj instanceof Lookup)
+ return obj.toString().equals(toString());
else return false;
} // equals
- /** *
+ /**
+ * *
*/
- public int hashCode(){ return toString().hashCode();}
-
+ public int hashCode() {
+ return toString().hashCode();
+ }
} // Lookup
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs