public class VectorMapSemanticSpace<T extends Vector> extends Object implements SemanticSpace, Serializable
SemanticSpace
wraps a Map
from strings to Vector
s. Both processDocument(java.io.BufferedReader)
and processSpace(java.util.Properties)
are
no-ops.Constructor and Description |
---|
VectorMapSemanticSpace(Map<String,T> wordSpace,
String spaceName,
int dimensions)
Creates a new
VectorMapSemanticSpace around the pre-existing
Map . |
Modifier and Type | Method and Description |
---|---|
String |
getSpaceName()
Returns a unique string describing the name and configuration of this
algorithm.
|
T |
getVector(String term)
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)
A no-op
|
void |
processSpace(Properties props)
A no-op
|
public Set<String> getWords()
getWords
in interface SemanticSpace
public T getVector(String term)
getVector
in interface SemanticSpace
term
- a word that may be in the semantic spaceVector
for the provided word or null
if the
word was not in the space.public String getSpaceName()
getSpaceName
in interface SemanticSpace
public int getVectorLength()
processSpace
is called.getVectorLength
in interface SemanticSpace
public void processDocument(BufferedReader document)
processDocument
in interface SemanticSpace
document
- a reader that allows access to the text of the documentpublic void processSpace(Properties props)
processSpace
in interface SemanticSpace
props
- a set of properties and values that may be used to
configure any exposed parameters of the algorithm.Copyright © 2012. All Rights Reserved.