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

edu.washington.cs.knowitall.nlp.ChunkedDocument Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
package edu.washington.cs.knowitall.nlp;

import java.util.Iterator;
import java.util.List;

import com.google.common.collect.ImmutableList;

/***
 * Represents an ordered collection of {@link ChunkedSentence} objects with an
 * identifier string.
 *
 * @author afader
 *
 */
public class ChunkedDocument implements Iterable {

    private String id;
    private List sents;

    /**
     * Constructs a new ChunkedDocument with the given identifier and sentences.
     *
     * @param id
     * @param sents
     */
    public ChunkedDocument(String id, Iterable sents) {
        this.id = id;
        this.sents = ImmutableList.copyOf(sents);
    }

    @Override
    public Iterator iterator() {
        return getSentences().iterator();
    }

    /**
     * @return an immutable view of the sentences in this document
     */
    public List getSentences() {
        return sents;
    }

    /**
     * @return the id of this document
     */
    public String getId() {
        return id;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy