edu.washington.cs.knowitall.nlp.ChunkedDocument Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of reverb-core Show documentation
Show all versions of reverb-core Show documentation
A regular-expression based Open IE relation extractor.
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;
}
}