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



Project stanfordnlp/CoreNLP in file ...anford.nlp.international.morph.MorphoFeatures.java (2013-08-19)
@@ -2,11 +2,11 @@ package edu.stanford.nlp.international.morph;
 
 import java.io.Serializable;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import edu.stanford.nlp.international.morph.MorphoFeatureSpecification.MorphoFeatureType;
+import edu.stanford.nlp.util.Generics;
 
 /**
  * Holds a set of morphosyntactic features for a given surface form.
@@ -24,7 +24,7 @@ public class MorphoFeatures implements Serializable {
   protected String altTag;
   
   public MorphoFeatures() {
-    fSpec = new HashMap<MorphoFeatureType,String>();
+    fSpec = Generics.newHashMap();
   }
   
   public MorphoFeatures(MorphoFeatures other) {
Project stanfordnlp/CoreNLP in file ...exparser.ChineseCharacterBasedLexiconTraining.java (2013-08-19)
@@ -12,7 +12,6 @@ import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -35,6 +34,7 @@ import edu.stanford.nlp.trees.WordCatConstituent;
 import edu.stanford.nlp.trees.WordCatEqualityChecker;
 import edu.stanford.nlp.trees.WordCatEquivalenceClasser;
 import edu.stanford.nlp.trees.international.pennchinese.RadicalMap;
+import edu.stanford.nlp.util.Generics;
 import edu.stanford.nlp.util.HashIndex;
 import edu.stanford.nlp.util.Index;
 import edu.stanford.nlp.util.StringUtils;
@@ -112,7 +112,7 @@ public class ChineseCharacterBasedLexiconTraining {
   }
 
   public static void main(String[] args) throws IOException {
-    Map<String,Integer> flagsToNumArgs = new HashMap<String, Integer>();
+    Map<String,Integer> flagsToNumArgs = Generics.newHashMap();
     flagsToNumArgs.put("-parser", Integer.valueOf(3));
     flagsToNumArgs.put("-lex", Integer.valueOf(3));
     flagsToNumArgs.put("-test", Integer.valueOf(2));
Project stanfordnlp/CoreNLP in file ...p.parser.lexparser.FrenchTreebankParserParams.java (2013-08-19)
@@ -2,7 +2,6 @@ package edu.stanford.nlp.parser.lexparser;
 
 import java.io.*;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.regex.Pattern;
@@ -32,6 +31,7 @@ import edu.stanford.nlp.trees.tregex.TregexMatcher;
 import edu.stanford.nlp.trees.tregex.TregexPattern;
 import edu.stanford.nlp.trees.tregex.TregexPatternCompiler;
 import edu.stanford.nlp.util.Function;
+import edu.stanford.nlp.util.Generics;
 import edu.stanford.nlp.util.Index;
 import edu.stanford.nlp.util.Pair;
 
@@ -76,7 +76,7 @@ public class FrenchTreebankParserParams extends AbstractTreebankParserParams {
     optionsString = new StringBuilder();
     optionsString.append("FrenchTreebankParserParams\n");
 
-    annotationPatterns = new HashMap<String,Pair<TregexPattern,Function<TregexMatcher,String>>>();
+    annotationPatterns = Generics.newHashMap();
     activeAnnotations = new ArrayList<Pair<TregexPattern,Function<TregexMatcher,String>>>();
 
     initializeAnnotationPatterns();
Project stanfordnlp/CoreNLP in file ...rc.edu.stanford.nlp.parser.lexparser.Interner.java (2013-08-19)
@@ -1,13 +1,13 @@
 package edu.stanford.nlp.parser.lexparser;
 
 import java.util.Map;
-import java.util.HashMap;
+import edu.stanford.nlp.util.Generics;
 
 /** (Someday this should be removed, but at present lexparser needs it)
  *  @author Dan Klein
  */
 class Interner<E> {
-  private Map<E, E> oToO = new HashMap<E, E>();
+  private Map<E, E> oToO = Generics.newHashMap();
 
   public E intern(E o) {
     E i = oToO.get(o);
Project stanfordnlp/CoreNLP in file ...u.stanford.nlp.parser.lexparser.PathExtractor.java (2013-08-19)
@@ -2,9 +2,9 @@ package edu.stanford.nlp.parser.lexparser;
 
 import edu.stanford.nlp.trees.HeadFinder;
 import edu.stanford.nlp.trees.Tree;
+import edu.stanford.nlp.util.Generics;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -16,7 +16,7 @@ import java.util.Map;
 class PathExtractor extends AbstractTreeExtractor<Map<String, List<List<String>>>> {
   private static final String END = "END";
   //protected final Index<String> stateIndex;
-  private Map<String, List<List<String>>> allPaths = new HashMap<String, List<List<String>>>();
+  private Map<String, List<List<String>>> allPaths = Generics.newHashMap();
   private HeadFinder hf;
 
   public PathExtractor(HeadFinder hf, Options op) {