public class DependencyBasisMaker.OccurrenceCounter extends Object implements SemanticSpace
SemanticSpace
implementation that counts word
co-occurrences, performs a transform, and then scores each recorded basis
dimension based on the row summed scores for each word.Constructor and Description |
---|
DependencyBasisMaker.OccurrenceCounter(Transform transform,
int bound,
DependencyPathAcceptor acceptor,
DependencyPathWeight weighter,
int pathLength)
Creates a new
DependencyBasisMaker.OccurrenceCounter . |
Modifier and Type | Method and Description |
---|---|
String |
getSpaceName()
Returns a unique string describing the name and configuration of this
algorithm.
|
DoubleVector |
getVector(String word)
Returns the semantic vector for the provided word.
|
int |
getVectorLength()
Returns the length of vectors in this semantic space.
|
Set<String> |
getWords()
Returns the set of words that are represented in this semantic space.
|
void |
processDocument(BufferedReader document)
Processes the contents of the provided file as a document.
|
void |
processSpace(Properties properties)
Once all the documents have been processed, performs any post-processing
steps on the data.
|
public DependencyBasisMaker.OccurrenceCounter(Transform transform, int bound, DependencyPathAcceptor acceptor, DependencyPathWeight weighter, int pathLength)
DependencyBasisMaker.OccurrenceCounter
.public void processDocument(BufferedReader document) throws IOException
processDocument
in interface SemanticSpace
document
- a reader that allows access to the text of the documentIOException
- if any error occurs while reading the documentpublic Set<String> getWords()
getWords
in interface SemanticSpace
public DoubleVector getVector(String word)
getVector
in interface SemanticSpace
word
- a word that may be in the semantic spaceVector
for the provided word or null
if the
word was not in the space.public int getVectorLength()
processSpace
is called.getVectorLength
in interface SemanticSpace
public void processSpace(Properties properties)
properties
argument.
By general contract, once this method has been called, processDocument
will not be called again.
processSpace
in interface SemanticSpace
properties
- a set of properties and values that may be used to
configure any exposed parameters of the algorithm.public String getSpaceName()
getSpaceName
in interface SemanticSpace
Copyright © 2012. All Rights Reserved.