Example usage for edu.stanford.nlp.util Index objectsList

List of usage examples for edu.stanford.nlp.util Index objectsList

Introduction

In this page you can find the example usage for edu.stanford.nlp.util Index objectsList.

Prototype

List<E> objectsList();

Source Link

Document

Returns a complete List of indexed objects, in the order of their indices.

Usage

From source file:conditionalCFG.ConditionalCFGParser.java

License:Open Source License

public ConditionalCFGParser(BinaryGrammar bg, UnaryGrammar ug, ConditionalLexicon lex, Options op,
        Index<String> stateIndex, Index<String> wordIndex, Index<String> tagIndex) {
    //    System.out.println("ExhaustivePCFGParser constructor called.");
    this.bg = bg;
    this.ug = ug;
    this.lex = lex;
    this.op = op;
    this.tlp = op.langpack();
    goalStr = tlp.startSymbol();/*from   ww  w. ja v a 2 s. com*/
    this.stateIndex = stateIndex;
    this.wordIndex = wordIndex;
    this.tagIndex = tagIndex;
    tf = new LabeledScoredTreeFactory();

    numStates = stateIndex.size();
    isTag = new boolean[numStates];
    // tag index is smaller, so we fill by iterating over the tag index
    // rather than over the state index
    for (String tag : tagIndex.objectsList()) {
        int state = stateIndex.indexOf(tag);
        if (state < 0) {
            continue;
        }
        isTag[state] = true;
    }
}