All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.stanford.nlp.parser.lexparser.Interner Maven / Gradle / Ivy

package edu.stanford.nlp.parser.lexparser;

import java.util.Map;
import edu.stanford.nlp.util.Generics;

/** (Someday this should be removed, but at present lexparser needs it)
 *  @author Dan Klein
 */
class Interner {
  private Map oToO = Generics.newHashMap();

  public E intern(E o) {
    E i = oToO.get(o);
    if (i == null) {
      i = o;
      oToO.put(o, o);
    }
    return i;
  }
}






© 2015 - 2024 Weber Informatics LLC | Privacy Policy