LBJ2.nlp
Class NLDocument

java.lang.Object
  extended by LBJ2.parse.LinkedChild
      extended by LBJ2.parse.LinkedVector
          extended by LBJ2.nlp.NLDocument
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class NLDocument
extends LinkedVector

Use this class to represent a natural language document. SentenceSplitter and Sentence.wordSplit() are used to represent the text of the document internally as a collection of vectors of words. As such, the text of the document is assumed plain, i.e. there should not be any mark-up.

See Also:
Serialized Form

Field Summary
private  java.lang.String fileName
          The name of the file this document came from.
 
Fields inherited from class LBJ2.parse.LinkedVector
children
 
Fields inherited from class LBJ2.parse.LinkedChild
end, next, parent, previous, start
 
Constructor Summary
NLDocument(NLDocument p, java.lang.String file)
          Creates a document from the contents of the named file.
NLDocument(NLDocument p, java.lang.String[] text)
          This constructor takes the entire text of the document in a String array as input and initializes the representation.
NLDocument(java.lang.String file)
          Creates a document from the contents of the named file.
NLDocument(java.lang.String[] text)
          This constructor takes the entire text of the document in a String array as input and initializes the representation.
 
Method Summary
 void addAll(SentenceSplitter splitter)
          Adds all the sentences that come from the argument sentence splitter to this document after using a word splitter to chop them up.
 java.lang.String getFileName()
          Returns the name of the file this document came from, or null if one was not specified.
 
Methods inherited from class LBJ2.parse.LinkedVector
add, clone, get, insert, remove, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileName

private java.lang.String fileName
The name of the file this document came from.

Constructor Detail

NLDocument

public NLDocument(java.lang.String[] text)
This constructor takes the entire text of the document in a String array as input and initializes the representation.

Parameters:
text - The entire text of the document. Each element of this array should represent a line of input without any line termination characters.

NLDocument

public NLDocument(NLDocument p,
                  java.lang.String[] text)
This constructor takes the entire text of the document in a String array as input and initializes the representation.

Parameters:
p - The previous child in the parent vector.
text - The entire text of the document. Each element of this array should represent a line of input without any line termination characters.

NLDocument

public NLDocument(java.lang.String file)
Creates a document from the contents of the named file.

Parameters:
file - The name of the file containing a natural language, plain text document.

NLDocument

public NLDocument(NLDocument p,
                  java.lang.String file)
Creates a document from the contents of the named file.

Parameters:
p - The previous child in the parent vector.
file - The name of the file containing a natural language, plain text document.
Method Detail

getFileName

public java.lang.String getFileName()
Returns the name of the file this document came from, or null if one was not specified.


addAll

public void addAll(SentenceSplitter splitter)
Adds all the sentences that come from the argument sentence splitter to this document after using a word splitter to chop them up.

Parameters:
splitter - A sentence splitter.