|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjxtract.Corpus
public class Corpus
This class represents one or more text files that make up a corpus.
Constructor Summary | |
---|---|
Corpus(java.lang.String filename_)
Constructor for the Corpus. |
Method Summary | |
---|---|
boolean |
closeFile()
Close the file if it was open. |
void |
countLines()
Count all the lines in the corpus and print to System.out. |
java.util.Vector |
getFrequentWords(int minFrequency)
|
java.util.Vector |
getSentencesWith(java.lang.String word_)
This returns a Vector of Strings, where each String is a sentence in the Corpus that contains the specified word. |
java.util.Vector |
getSentencesWith(java.lang.String w1,
java.lang.String w2,
int distance)
This returns a Vector of Strings, where each String is a sentence in the Corpus that contains the specified words, with w2 being
distance words away from w1 . |
boolean |
openFile()
Open the file for reading. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Corpus(java.lang.String filename_)
filename_
- The text file that contains the corpus.Method Detail |
---|
public boolean openFile()
true
if the open succeeded, false
if the open failed.public boolean closeFile()
true
if the file was already closed or the
operation closed it. false
if the file is still
open after execution.public java.util.Vector getSentencesWith(java.lang.String word_)
word
- The word that is searched for in the corpus.
public java.util.Vector getSentencesWith(java.lang.String w1, java.lang.String w2, int distance)
w2
being
distance
words away from w1
.
w1
- The first wordw2
- The second worddistance
- The distance between them. -5 to -1 and 1 to 5 are valid values.
public void countLines()
public java.util.Vector getFrequentWords(int minFrequency)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |