java.util.HashMapedu.stanford.nlp.util.Generics



Project stanfordnlp/CoreNLP in file ...b971d3f066/src.edu.stanford.nlp.ie.crf.NERGUI.java (2013-08-19)
@@ -28,6 +28,7 @@
 package edu.stanford.nlp.ie.crf;
 
 import edu.stanford.nlp.ie.AbstractSequenceClassifier;
+import edu.stanford.nlp.util.Generics;
 import edu.stanford.nlp.util.StringUtils;
 
 import javax.swing.*;
@@ -38,7 +39,6 @@ import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
 import java.io.File;
-import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 import java.util.regex.Matcher;
@@ -692,7 +692,7 @@ public class NERGUI {
                                                      String backgroundSymbol) {
     int numColors = tags.size() - 1;
     Color[] colors = getNColors(numColors);
-    Map<String, Color> result = new HashMap<String, Color>();
+    Map<String, Color> result = Generics.newHashMap();
 
     int i = 0;
     for (String tag : tags) {
Project stanfordnlp/CoreNLP in file ...inereading.domains.ace.reader.AceEventMention.java (2013-08-19)
@@ -2,10 +2,11 @@
 package edu.stanford.nlp.ie.machinereading.domains.ace.reader;
 
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
+import edu.stanford.nlp.util.Generics;
+
 /**
  * Stores one ACE event mention
  */
@@ -22,7 +23,7 @@ public class AceEventMention extends AceMention {
 
   public AceEventMention(String id, AceCharSeq extent, AceCharSeq anchor) {
     super(id, extent);
-    mRolesToArguments = new HashMap<String, AceEventMentionArgument>();
+    mRolesToArguments = Generics.newHashMap();
     this.mAnchor = anchor;
   }
 
Project stanfordnlp/CoreNLP in file ...ernational.arabic.pipeline.UniversalPOSMapper.java (2013-08-19)
@@ -1,7 +1,6 @@
 package edu.stanford.nlp.international.arabic.pipeline;
 
 import java.io.*;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -9,6 +8,7 @@ import edu.stanford.nlp.international.arabic.ArabicMorphoFeatureSpecification;
 import edu.stanford.nlp.international.morph.MorphoFeatureSpecification;
 import edu.stanford.nlp.international.morph.MorphoFeatures;
 import edu.stanford.nlp.international.morph.MorphoFeatureSpecification.MorphoFeatureType;
+import edu.stanford.nlp.util.Generics;
 
 /**
  * Maps LDC-provided Bies mappings to the Universal POS tag set described in
@@ -28,7 +28,7 @@ public class UniversalPOSMapper extends LDCPosMapper {
   public UniversalPOSMapper(){
     super(false); //Don't add the determiner split
     
-    universalMap = new HashMap<String,String>();
+    universalMap = Generics.newHashMap();
     morphoSpec = new ArabicMorphoFeatureSpecification();
   }
   
Project stanfordnlp/CoreNLP in file ....nlp.international.arabic.subject.DataLabeler.java (2013-08-19)
@@ -1,10 +1,10 @@
 package edu.stanford.nlp.international.arabic.subject;
 
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
+import edu.stanford.nlp.util.Generics;
 import edu.stanford.nlp.util.PropertiesUtils;
 import edu.stanford.nlp.util.StringUtils;
 
@@ -33,7 +33,7 @@ public final class DataLabeler {
   }
 
   private static Map<String, Integer> optionArgDefs() {
-    Map<String,Integer> optionArgDefs = new HashMap<String,Integer>();
+    Map<String,Integer> optionArgDefs = Generics.newHashMap();
     optionArgDefs.put("v", 0);
     optionArgDefs.put("g", 0);
     optionArgDefs.put("f", 1);
Project stanfordnlp/CoreNLP in file ....nlp.international.morph.AddMorphoAnnotations.java (2013-08-19)
@@ -3,7 +3,6 @@ package edu.stanford.nlp.international.morph;
 import java.io.*;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -15,6 +14,7 @@ import edu.stanford.nlp.trees.Tree;
 import edu.stanford.nlp.trees.TreeReader;
 import edu.stanford.nlp.trees.TreeReaderFactory;
 import edu.stanford.nlp.trees.international.arabic.ArabicTreeReaderFactory;
+import edu.stanford.nlp.util.Generics;
 import edu.stanford.nlp.util.PropertiesUtils;
 import edu.stanford.nlp.util.StringUtils;
 
@@ -39,7 +39,7 @@ public final class AddMorphoAnnotations {
     return sb.toString();
   }
   private static Map<String,Integer> argSpec() {
-    Map<String,Integer> argSpec = new HashMap<String,Integer>();
+    Map<String,Integer> argSpec = Generics.newHashMap();
     argSpec.put("g", 0);
     argSpec.put("e", 1);
     return argSpec;