public class BigramExtractor extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BigramExtractor.SignificanceTest
The significance tests to use in determing how two tokens are
statistically related in their occurrences.
|
Constructor and Description |
---|
BigramExtractor()
Creates a new bigram extractor
|
BigramExtractor(int expectedNumBigrams)
Creates a new bigram extractor that expects approximately the specified
number of bigrams
|
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args) |
void |
printBigrams(PrintWriter output,
BigramExtractor.SignificanceTest test,
int minOccurrencePerToken)
Prints all of the known bigrams, where each token in the
bigram must occur at least the number of specified time.
|
void |
process(BufferedReader text)
Processes the tokens in the reader to gather statistics for any bigrams
contained therein
|
void |
process(Iterator<String> text)
Processes the tokens in the iterator to gather statistics for any bigrams
contained therein
|
void |
process(String text)
Processes the tokens in the text to gather statistics for any bigrams
contained therein
|
public BigramExtractor()
public BigramExtractor(int expectedNumBigrams)
public void process(String text)
public void process(BufferedReader text)
public void process(Iterator<String> text)
public void printBigrams(PrintWriter output, BigramExtractor.SignificanceTest test, int minOccurrencePerToken)
output
- the writer where all the bigrams should be printedtest
- the significant test to use in rating the statistical
correlation of two tokensminOccurrencePerToken
- the minimum number of times each token in a
bigram must occur for the bigram's score to be reportedpublic static void main(String[] args)
Copyright © 2012. All Rights Reserved.