edu.stanford.nlp.parser.lexparser.Interner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stanford-parser Show documentation
Show all versions of stanford-parser Show documentation
Stanford Parser processes raw text in English, Chinese, German, Arabic, and French, and extracts constituency parse trees.
The newest version!
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;
}
}