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

edu.stanford.nlp.tagger.maxent.HistoryTable Maven / Gradle / Ivy

Go to download

Stanford CoreNLP provides a set of natural language analysis tools which can take raw English language text input and give the base forms of words, their parts of speech, whether they are names of companies, people, etc., normalize dates, times, and numeric quantities, mark up the structure of sentences in terms of phrases and word dependencies, and indicate which noun phrases refer to the same entities. It provides the foundational building blocks for higher level text understanding applications.

There is a newer version: 4.5.7
Show newest version
/**
 * Title:        StanfordMaxEnt

* Description: A Maximum Entropy Toolkit

* Copyright: Copyright (c) Kristina Toutanova

* Company: Stanford University

*/ package edu.stanford.nlp.tagger.maxent; import edu.stanford.nlp.util.Index; import edu.stanford.nlp.util.HashIndex; /** * Notes: This maintains a two way lookup between a History and * an Integer index. * * @author Kristina Toutanova * @version 1.0 */ public class HistoryTable { // todo cdm: just remove this class and use the Index directly where uses of it appears? private static final int capacity = 1000000; private final Index idx; public HistoryTable() { idx = new HashIndex<>(capacity); } void release() { idx.clear(); } int add(History h) { return idx.addToIndex(h); } History getHistory(int index) { return idx.get(index); } int getIndex(History h) { return idx.indexOf(h); } int size() { return idx.size(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy