public class WordComparator extends Object
k
most-similar words to a provided
word in a SemanticSpace
. The comparisons required for generating the
list maybe be run in parallel by configuring an instance of this class to use
multiple threads. All instances of this class are thread-safe.
Constructor and Description |
---|
WordComparator()
Creates this
WordComparator with as many threads as processors. |
WordComparator(int numThreads)
Creates this
WordComparator with the specified number of threads. |
Modifier and Type | Method and Description |
---|---|
SortedMultiMap<Double,String> |
getMostSimilar(String word,
SemanticSpace sspace,
int numberOfSimilarWords,
Similarity.SimType similarityType)
Compares the provided word to all other words in the provided
SemanticSpace and return the specified number of words that were most
similar according to the specified similarity measure. |
public WordComparator()
WordComparator
with as many threads as processors.public WordComparator(int numThreads)
WordComparator
with the specified number of threads.public SortedMultiMap<Double,String> getMostSimilar(String word, SemanticSpace sspace, int numberOfSimilarWords, Similarity.SimType similarityType)
SemanticSpace
and return the specified number of words that were most
similar according to the specified similarity measure.null
if the provided word was
not in the semantic space.Copyright © 2012. All Rights Reserved.