public class PurandareFirstOrder extends Object implements SemanticSpace
Integer.MAX_VALUE
Modifier and Type | Field and Description |
---|---|
static String |
MAX_CONTEXTS_PER_WORD
The property to set the upper-bound on the maximum number of contexts to
be clustered for a single word.
|
Constructor and Description |
---|
PurandareFirstOrder()
Creates a new instance of
PurandareFirstOrder using the system
properties for configuration |
PurandareFirstOrder(Properties props)
Creates a new instance of
PurandareFirstOrder using the provided
properties for configuration |
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 static final String MAX_CONTEXTS_PER_WORD
public PurandareFirstOrder()
PurandareFirstOrder
using the system
properties for configurationpublic PurandareFirstOrder(Properties props)
PurandareFirstOrder
using the provided
properties for configurationpublic 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 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 int getVectorLength()
processSpace
is called.getVectorLength
in interface SemanticSpace
public String getSpaceName()
getSpaceName
in interface SemanticSpace
Copyright © 2012. All Rights Reserved.