public class GeneralContextExtractor extends Object implements ContextExtractor
ContextExtractor
. This extractor assumes that
documents are simply raw text and contexts should be defined by word
co-occurrences. This class depends on a ContextGenerator
for
generating context vectors.Constructor and Description |
---|
GeneralContextExtractor(ContextGenerator generator,
int windowSize,
boolean readHeader)
Creates a new
GeneralContextExtracto . |
Modifier and Type | Method and Description |
---|---|
int |
getVectorLength()
Returns the maximum number of dimensions used to represent any given
context.
|
void |
processDocument(BufferedReader document,
Wordsi wordsi)
Processes the content of
document and calls Wordsi.handleContextVector(java.lang.String, java.lang.String, edu.ucla.sspace.vector.SparseDoubleVector) for each context vector that can be extracted
from document . |
public GeneralContextExtractor(ContextGenerator generator, int windowSize, boolean readHeader)
GeneralContextExtracto
.generator
- The ContextGenerator
responsible for creating
context vectorswindowSize
- The number of words before and after the focus word
which compose a contextpublic int getVectorLength()
getVectorLength
in interface ContextExtractor
public void processDocument(BufferedReader document, Wordsi wordsi)
document
and calls Wordsi.handleContextVector(java.lang.String, java.lang.String, edu.ucla.sspace.vector.SparseDoubleVector)
for each context vector that can be extracted
from document
.processDocument
in interface ContextExtractor
Copyright © 2012. All Rights Reserved.