public class AssociationTable extends AbstractDataset
| Constructor and Description |
|---|
AssociationTable(DatasetSpecification spec,
Table table) |
| Modifier and Type | Method and Description |
|---|---|
long |
getAssoc(String word1,
String word2)
Returns how many times two words occured together.
|
Map<String,Long> |
readWordAssocs(String word,
int limit)
Returns the top words associated with the specified word and the number
of times the words have appeared together.
|
void |
writeWordAssocs(Set<String> words)
Stores associations between the specified set of words.
|
close, commitTx, getName, getTransactionAwareName, getTxChanges, postTxCommit, rollbackTx, setMetricsCollector, startTx, toString, updateTxpublic AssociationTable(DatasetSpecification spec, Table table)
public void writeWordAssocs(Set<String> words)
words - words to store associations betweenpublic Map<String,Long> readWordAssocs(String word, int limit)
word - the word of interestlimit - the number of associations to return, at mostCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.