edu.cmu.minorthird.text
Class MutableTextBase

java.lang.Object
  extended by edu.cmu.minorthird.text.AbstractTextBase
      extended by edu.cmu.minorthird.text.MutableTextBase
All Implemented Interfaces:
TextBase
Direct Known Subclasses:
BasicTextBase

public abstract class MutableTextBase
extends AbstractTextBase

Author:
Quinten Mercer

Field Summary
 
Fields inherited from class edu.cmu.minorthird.text.AbstractTextBase
tokenizer
 
Constructor Summary
MutableTextBase(Tokenizer t)
           
 
Method Summary
abstract  Span documentSpan(java.lang.String documentId)
          Looks up the document Span for the given documentId.
abstract  java.util.Iterator<Span> documentSpanIterator()
          Returns an iterator over the documents in this TextBase.
abstract  Document getDocument(java.lang.String docID)
          Returns the Document with the given ID
abstract  void loadDocument(java.lang.String documentId, java.lang.String text)
          Creates a new document for the document contained in documentString and referenced by documentId.
abstract  void loadDocument(java.lang.String documentId, java.lang.String documentString, int charOffset)
          Creates a new document for the document contained in documentString and referenced by documentId.
abstract  void setDocumentGroupId(java.lang.String documentId, java.lang.String documentGroupId)
          Sets the group that a document belongs to
abstract  int size()
          Returns the number of documents contained in this TextBase.
 
Methods inherited from class edu.cmu.minorthird.text.AbstractTextBase
getTokenizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableTextBase

public MutableTextBase(Tokenizer t)
Method Detail

loadDocument

public abstract void loadDocument(java.lang.String documentId,
                                  java.lang.String text)
Creates a new document for the document contained in documentString and referenced by documentId.
Tokenizes documentString using the Tokenizer set for this TextBase.
New document is stored in the TextBase.


loadDocument

public abstract void loadDocument(java.lang.String documentId,
                                  java.lang.String documentString,
                                  int charOffset)
Creates a new document for the document contained in documentString and referenced by documentId.
Also, sets the char offset to indicate that this document is a subdocument of another.
Tokenizes documentString using the Tokenizer set for this TextBase.
New document is stored in the TextBase.


setDocumentGroupId

public abstract void setDocumentGroupId(java.lang.String documentId,
                                        java.lang.String documentGroupId)
Sets the group that a document belongs to


size

public abstract 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

getDocument

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

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

documentSpanIterator

public abstract 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 abstract 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