Revision: 17638
          http://sourceforge.net/p/gate/code/17638
Author:   markagreenwood
Date:     2014-03-12 09:36:47 +0000 (Wed, 12 Mar 2014)
Log Message:
-----------
finally figured out the type of the other map -- it was hidden in plain sight 
of course :)

Modified Paths:
--------------
    gate/trunk/src/main/gate/DocumentFormat.java
    gate/trunk/src/main/gate/corpora/EmailDocumentFormat.java
    gate/trunk/src/main/gate/email/EmailDocumentHandler.java
    gate/trunk/src/main/gate/html/HtmlDocumentHandler.java
    gate/trunk/src/main/gate/xml/XmlDocumentHandler.java

Modified: gate/trunk/src/main/gate/DocumentFormat.java
===================================================================
--- gate/trunk/src/main/gate/DocumentFormat.java        2014-03-12 09:20:08 UTC 
(rev 17637)
+++ gate/trunk/src/main/gate/DocumentFormat.java        2014-03-12 09:36:47 UTC 
(rev 17638)
@@ -85,7 +85,7 @@
     * for annotation types. If it is non-null, only those elements specified
     * here will be converted.
     */
-  protected Map markupElementsMap = null;
+  protected Map<String,String> markupElementsMap = null;
 
   /** This map is used inside uppackMarkup() method...
     * When an element from the map is encounted, The corresponding string
@@ -441,6 +441,7 @@
     * Return the fileSuffix or null if the url doesn't have a file suffix
     * If the url is null then the file suffix will be null also
     */
+  @SuppressWarnings("unused")
   private static String getFileSuffix(URL url){
     String fileName = null;
     String fileSuffix = null;
@@ -558,13 +559,13 @@
   public FeatureMap getFeatures() { return features; }
 
    /** Get the markup elements map */
-  public Map getMarkupElementsMap() { return markupElementsMap; }
+  public Map<String,String> getMarkupElementsMap() { return markupElementsMap; 
}
 
    /** Get the element 2 string map */
   public Map<String,String> getElement2StringMap() { return element2StringMap; 
}
 
   /** Set the markup elements map */
-  public void setMarkupElementsMap(Map markupElementsMap) {
+  public void setMarkupElementsMap(Map<String,String> markupElementsMap) {
    this.markupElementsMap = markupElementsMap;
   }
 

Modified: gate/trunk/src/main/gate/corpora/EmailDocumentFormat.java
===================================================================
--- gate/trunk/src/main/gate/corpora/EmailDocumentFormat.java   2014-03-12 
09:20:08 UTC (rev 17637)
+++ gate/trunk/src/main/gate/corpora/EmailDocumentFormat.java   2014-03-12 
09:36:47 UTC (rev 17638)
@@ -16,10 +16,10 @@
 
 package gate.corpora;
 
-import java.io.IOException;
-import java.util.Iterator;
-
-import gate.*;
+import gate.Annotation;
+import gate.AnnotationSet;
+import gate.GateConstants;
+import gate.Resource;
 import gate.creole.ResourceInstantiationException;
 import gate.creole.metadata.AutoInstance;
 import gate.creole.metadata.CreoleResource;
@@ -28,7 +28,8 @@
 import gate.util.DocumentFormatException;
 import gate.util.InvalidOffsetException;
 
-//import org.w3c.www.mime.*;
+import java.io.IOException;
+import java.util.Iterator;
 
 /** The format of Documents. Subclasses of DocumentFormat know about
   * particular MIME types and how to unpack the information in any

Modified: gate/trunk/src/main/gate/email/EmailDocumentHandler.java
===================================================================
--- gate/trunk/src/main/gate/email/EmailDocumentHandler.java    2014-03-12 
09:20:08 UTC (rev 17637)
+++ gate/trunk/src/main/gate/email/EmailDocumentHandler.java    2014-03-12 
09:36:47 UTC (rev 17638)
@@ -55,7 +55,7 @@
     * Constructor initialises some private fields
     */
   public EmailDocumentHandler( gate.Document aGateDocument,
-                               Map  aMarkupElementsMap,
+                               Map<String,String>  aMarkupElementsMap,
                                Map<String,String>  anElement2StringMap
                               ) {
 
@@ -639,9 +639,11 @@
   private gate.AnnotationSet basicAS = null;
 
   // this map marks the elements that we don't want to create annotations
-  private Map  markupElementsMap = null;
+  @SuppressWarnings("unused")
+  private Map<String,String>  markupElementsMap = null;
 
   // this map marks the elements after we want to insert some strings
+  @SuppressWarnings("unused")
   private Map<String,String> element2StringMap = null;
 
   // listeners for status report

Modified: gate/trunk/src/main/gate/html/HtmlDocumentHandler.java
===================================================================
--- gate/trunk/src/main/gate/html/HtmlDocumentHandler.java      2014-03-12 
09:20:08 UTC (rev 17637)
+++ gate/trunk/src/main/gate/html/HtmlDocumentHandler.java      2014-03-12 
09:36:47 UTC (rev 17638)
@@ -55,7 +55,7 @@
     * @param aMarkupElementsMap The map containing the elements that will
     * transform into annotations
     */
-  public HtmlDocumentHandler(gate.Document aDocument, Map aMarkupElementsMap) {
+  public HtmlDocumentHandler(gate.Document aDocument, Map<String,String> 
aMarkupElementsMap) {
     this(aDocument,aMarkupElementsMap,null);
   }
 
@@ -67,7 +67,7 @@
     * resulted from the processing of the gate document
     */
   public HtmlDocumentHandler(gate.Document       aDocument,
-                             Map                 aMarkupElementsMap,
+                             Map<String,String>  aMarkupElementsMap,
                              gate.AnnotationSet  anAnnotationSet) {
     // init stack
     stack = new Stack<CustomObject>();
@@ -241,7 +241,7 @@
                            );
             }else{
               String annotationType =
-                     (String) markupElementsMap.get(obj.getElemName());
+                     markupElementsMap.get(obj.getElemName());
               if (annotationType != null)
                  basicAS.add( obj.getStart(),
                               obj.getEnd(),
@@ -574,7 +574,7 @@
   // if it's null all the elements from the HTML documents will be transformed
   // into Gate annotation objects otherwise only the elements it contains will
   // be transformed
-  private Map markupElementsMap = null;
+  private Map<String,String> markupElementsMap = null;
 
   // the content of the HTML document, without any tag
   // for internal use

Modified: gate/trunk/src/main/gate/xml/XmlDocumentHandler.java
===================================================================
--- gate/trunk/src/main/gate/xml/XmlDocumentHandler.java        2014-03-12 
09:20:08 UTC (rev 17637)
+++ gate/trunk/src/main/gate/xml/XmlDocumentHandler.java        2014-03-12 
09:36:47 UTC (rev 17638)
@@ -109,7 +109,7 @@
    * @param anElement2StringMap this map contains the strings that will be
    * added to the text contained by the key element.
    */
-  public XmlDocumentHandler(gate.Document aDocument, Map aMarkupElementsMap,
+  public XmlDocumentHandler(gate.Document aDocument, Map<String,String> 
aMarkupElementsMap,
           Map<String,String> anElement2StringMap) {
     this(aDocument, aMarkupElementsMap, anElement2StringMap, null);
   } // XmlDocumentHandler
@@ -125,7 +125,7 @@
    * document was processed
    */
   public XmlDocumentHandler(gate.Document aDocument,
-          Map aMarkupElementsMap,
+          Map<String,String> aMarkupElementsMap,
           Map<String,String> anElement2StringMap,
           AnnotationSet anAnnotationSet) {
     // init parent
@@ -232,7 +232,7 @@
                   obj.getFM());
         } else {
           // get the type of the annotation from Map
-          String annotationType = (String) 
markupElementsMap.get(obj.getElemName());
+          String annotationType = markupElementsMap.get(obj.getElemName());
           if (annotationType != null) {
             basicAS.add(obj.getId(),
                     obj.getStart(),
@@ -664,6 +664,7 @@
    * It receives a qualified name and returns its local name.
    * For eg. if it receives gate:gateId it will return gateId
    */
+  @SuppressWarnings("unused")
   private String getMyLocalName(String aQName) {
     if (aQName == null) {
       return "";
@@ -705,7 +706,7 @@
   // if it's null all the elements from the XML documents will be transformed
   // into Gate annotation objects otherwise only the elements it contains will
   // be transformed
-  private Map markupElementsMap = null;
+  private Map<String,String> markupElementsMap = null;
   // this map contains the string that we want to insert iside the document
   // content, when a certain element is found
   // if the map is null then no string is added

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to