edu.cmu.minorthird.text.learn.experiments
Class SubTextBase

java.lang.Object
  extended by edu.cmu.minorthird.text.AbstractTextBase
      extended by edu.cmu.minorthird.text.learn.experiments.SubTextBase
All Implemented Interfaces:
TextBase

public class SubTextBase
extends AbstractTextBase

A read-only TextBase which is a subset of another TextBase.

Author:
William Cohen

Nested Class Summary
static class SubTextBase.UnknownDocumentException
           
 
Field Summary
 
Fields inherited from class edu.cmu.minorthird.text.AbstractTextBase
tokenizer
 
Constructor Summary
SubTextBase(TextBase base, java.util.Iterator<Span> documentSpanIterator)
           
 
Method Summary
 boolean contains(Span span)
          True if a span is contained by this TextBase
 Span documentSpan(java.lang.String documentId)
          Looks up the document Span for the given documentId.
 java.util.Iterator<Span> documentSpanIterator()
          Returns an iterator over the documents in this TextBase.
 Document getDocument(java.lang.String documentId)
          Returns the Document with the given ID
 Tokenizer getTokenizer()
          Returns the Tokenizer used on the documents in this text base.
 int size()
          Returns the number of documents contained in this TextBase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubTextBase

public SubTextBase(TextBase base,
                   java.util.Iterator<Span> documentSpanIterator)
            throws SubTextBase.UnknownDocumentException
Throws:
SubTextBase.UnknownDocumentException
Method Detail

contains

public boolean contains(Span span)
True if a span is contained by this TextBase


getTokenizer

public Tokenizer getTokenizer()
Description copied from interface: TextBase
Returns the Tokenizer used on the documents in this text base.

Specified by:
getTokenizer in interface TextBase
Overrides:
getTokenizer in class AbstractTextBase

getDocument

public Document getDocument(java.lang.String documentId)
Description copied from interface: TextBase
Returns the Document with the given ID

Specified by:
getDocument in interface TextBase
Specified by:
getDocument in class AbstractTextBase

size

public int size()
Description copied from interface: TextBase
Returns the number of documents contained in this TextBase.

Specified by:
size in interface TextBase
Specified by:
size in class AbstractTextBase

documentSpanIterator

public java.util.Iterator<Span> documentSpanIterator()
Description copied from interface: TextBase
Returns an iterator over the documents in this TextBase.

Specified by:
documentSpanIterator in interface TextBase
Specified by:
documentSpanIterator in class AbstractTextBase

documentSpan

public Span documentSpan(java.lang.String documentId)
Description copied from interface: TextBase
Looks up the document Span for the given documentId. Returns the Span or null if a document with documentId was not found in this TextBase.

Specified by:
documentSpan in interface TextBase
Specified by:
documentSpan in class AbstractTextBase