edu.stanford.nlp.util.Generics



Project stanfordnlp/CoreNLP in file ....parser.shiftreduce.CombinationFeatureFactory.java (2015-03-12)
@@ -2,8 +2,6 @@ package edu.stanford.nlp.parser.shiftreduce;
 
 import java.util.List;
 
-import edu.stanford.nlp.util.Generics;
-
 /**
  * Combines multiple feature factories into one feature factory
  *
@@ -15,7 +13,7 @@ public class CombinationFeatureFactory extends FeatureFactory {
   public CombinationFeatureFactory(FeatureFactory[] factories) {
     this.factories = factories;
   }
-  
+
   @Override
   public List<String> featurize(State state, List<String> features) {
     for (FeatureFactory factory : factories) {
@@ -24,5 +22,5 @@ public class CombinationFeatureFactory extends FeatureFactory {
     return features;
   }
 
-  private static final long serialVersionUID = 1;  
+  private static final long serialVersionUID = 1;
 }
Project stanfordnlp/CoreNLP in file ....parser.lexparser.EnglishTreebankParserParams.java (2014-03-25)
@@ -4,7 +4,6 @@ import edu.stanford.nlp.io.RuntimeIOException;
 import edu.stanford.nlp.ling.*;
 import edu.stanford.nlp.trees.*;
 import edu.stanford.nlp.util.Filter;
-import edu.stanford.nlp.util.Generics;
 import edu.stanford.nlp.util.Index;
 
 import java.io.IOException;
@@ -141,7 +140,7 @@ public class EnglishTreebankParserParams extends AbstractTreebankParserParams {
 
   @Override
   public HeadFinder typedDependencyHeadFinder() {
-    return new SemanticHeadFinder(treebankLanguagePack(), !englishTest.makeCopulaHead);
+    return new SemanticHeadFinder(!englishTest.makeCopulaHead);
   }
 
 
Project stanfordnlp/CoreNLP in file ...ord.nlp.trees.tregex.tsurgeon.TsurgeonPattern.java (2015-02-18)
@@ -32,7 +32,6 @@ import java.util.Map;
 
 import edu.stanford.nlp.trees.Tree;
 import edu.stanford.nlp.trees.tregex.TregexMatcher;
-import edu.stanford.nlp.util.Generics;
 
 
 /**
@@ -48,7 +47,8 @@ public abstract class TsurgeonPattern {
   final String label;
   final TsurgeonPattern[] children;
 
-  TsurgeonPattern root; // TODO: can remove?
+  TsurgeonPattern root; // TODO: can remove? Nothing seems to look at it.
+
   protected void setRoot(TsurgeonPatternRoot root) {
     this.root = root;
     for (TsurgeonPattern child : children) {
@@ -87,6 +87,7 @@ public abstract class TsurgeonPattern {
   public TsurgeonMatcher matcher() {
     throw new UnsupportedOperationException("Only the root node can produce the top level matcher");
   }
-  
+
   public abstract TsurgeonMatcher matcher(Map<String,Tree> newNodeNames, CoindexationGenerator coindexer);
+
 }
Project stanfordnlp/CoreNLP in file ...a/src.edu.stanford.nlp.classify.KNNClassifier.java (2015-03-14)
@@ -6,7 +6,6 @@ import edu.stanford.nlp.ling.Datum;
 import edu.stanford.nlp.ling.RVFDatum;
 import edu.stanford.nlp.stats.*;
 import edu.stanford.nlp.util.CollectionValuedMap;
-import edu.stanford.nlp.util.Generics;
 
 /**
  * A simple k-NN classifier, with the options of using unit votes, or weighted votes (by 
@@ -26,7 +25,7 @@ public class KNNClassifier<K,V> implements Classifier<K, V> {
   private static final long serialVersionUID = 7115357548209007944L;
   private boolean weightedVotes = false; // whether this is a weighted vote (by sim), or not
   private CollectionValuedMap<K, Counter<V>> instances = new CollectionValuedMap<K, Counter<V>>();
-  private Map<Counter<V>, K> classLookup = Generics.newHashMap();
+  private Map<Counter<V>, K> classLookup = new HashMap<Counter<V>, K>();
   private boolean l2Normalize = false;
   int k = 0;
 
Project stanfordnlp/CoreNLP in file ...international.arabic.pipeline.GaleP4LexMapper.java (2015-03-14)
@@ -5,7 +5,6 @@ import java.util.*;
 import java.util.regex.*;
 
 import edu.stanford.nlp.trees.treebank.Mapper;
-import edu.stanford.nlp.util.Generics;
 
 /**
  * Applies a default set of lexical transformations that have been empirically validated
@@ -43,7 +42,7 @@ public class GaleP4LexMapper implements Mapper {
   public GaleP4LexMapper() {
 
     //Tags for the canChangeEncoding() method
-    parentTagsToEscape = Generics.newHashSet();
+    parentTagsToEscape = new HashSet<String>();
     parentTagsToEscape.add("PUNC");
     parentTagsToEscape.add("LATIN");
     parentTagsToEscape.add("-NONE-");