|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectLBJ2.parse.LinkedChild
LBJ2.parse.LinkedVector
LBJ2.nlp.NLDocument
public class NLDocument
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.
| 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 |
|---|
private java.lang.String fileName
| Constructor Detail |
|---|
public NLDocument(java.lang.String[] text)
text - The entire text of the document. Each element of this array
should represent a line of input without any line
termination characters.
public NLDocument(NLDocument p,
java.lang.String[] text)
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.public NLDocument(java.lang.String file)
file - The name of the file containing a natural language, plain
text document.
public NLDocument(NLDocument p,
java.lang.String file)
p - The previous child in the parent vector.file - The name of the file containing a natural language, plain
text document.| Method Detail |
|---|
public java.lang.String getFileName()
null if one was not specified.
public void addAll(SentenceSplitter splitter)
splitter - A sentence splitter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||