public class PhraseAnalyzerObjectDbDao extends Object implements PhraseAnalyzerDao
Modifier and Type | Class and Description |
---|---|
static class |
PhraseAnalyzerObjectDbDao.Provider |
Constructor and Description |
---|
PhraseAnalyzerObjectDbDao(org.wikibrain.core.lang.StringNormalizer normalizer,
File path,
boolean isNew)
Creates a new dao using the given directory.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the dao and flushes any unwritten data to disk.
|
void |
flush() |
Iterator<org.apache.commons.lang3.tuple.Pair<String,PrunedCounts<Integer>>> |
getAllPhraseCounts(org.wikibrain.core.lang.Language lang)
Returns all phrase counts in the specified language.
|
Iterator<String> |
getAllPhrases(org.wikibrain.core.lang.Language lang)
Returns all phrases in the specified language.
|
PrunedCounts<String> |
getPageCounts(org.wikibrain.core.lang.Language lang,
int wpId,
int maxPhrases)
Gets phrases related to a page.
|
PrunedCounts<Integer> |
getPhraseCounts(org.wikibrain.core.lang.Language lang,
String phrase,
int maxPages)
Gets pages related to a phrase.
|
org.wikibrain.core.lang.StringNormalizer |
getStringNormalizer() |
void |
savePageCounts(org.wikibrain.core.lang.Language lang,
int wpId,
PrunedCounts<String> counts)
Adds information mapping a page to phrases.
|
void |
savePhraseCounts(org.wikibrain.core.lang.Language lang,
String phrase,
PrunedCounts<Integer> counts)
Adds information mapping a phrase to pages.
|
public PhraseAnalyzerObjectDbDao(org.wikibrain.core.lang.StringNormalizer normalizer, File path, boolean isNew) throws org.wikibrain.core.dao.DaoException
path
- isNew
- If true, delete any information contained in the directory.org.wikibrain.core.dao.DaoException
public void savePageCounts(org.wikibrain.core.lang.Language lang, int wpId, PrunedCounts<String> counts) throws org.wikibrain.core.dao.DaoException
PhraseAnalyzerDao
savePageCounts
in interface PhraseAnalyzerDao
org.wikibrain.core.dao.DaoException
public void savePhraseCounts(org.wikibrain.core.lang.Language lang, String phrase, PrunedCounts<Integer> counts) throws org.wikibrain.core.dao.DaoException
PhraseAnalyzerDao
savePhraseCounts
in interface PhraseAnalyzerDao
org.wikibrain.core.dao.DaoException
public Iterator<String> getAllPhrases(org.wikibrain.core.lang.Language lang)
PhraseAnalyzerDao
getAllPhrases
in interface PhraseAnalyzerDao
public Iterator<org.apache.commons.lang3.tuple.Pair<String,PrunedCounts<Integer>>> getAllPhraseCounts(org.wikibrain.core.lang.Language lang)
PhraseAnalyzerDao
getAllPhraseCounts
in interface PhraseAnalyzerDao
public org.wikibrain.core.lang.StringNormalizer getStringNormalizer()
getStringNormalizer
in interface PhraseAnalyzerDao
public PrunedCounts<Integer> getPhraseCounts(org.wikibrain.core.lang.Language lang, String phrase, int maxPages) throws org.wikibrain.core.dao.DaoException
getPhraseCounts
in interface PhraseAnalyzerDao
lang
- phrase
- maxPages
- org.wikibrain.core.dao.DaoException
public PrunedCounts<String> getPageCounts(org.wikibrain.core.lang.Language lang, int wpId, int maxPhrases) throws org.wikibrain.core.dao.DaoException
getPageCounts
in interface PhraseAnalyzerDao
lang
- wpId
- Local page idmaxPhrases
- org.wikibrain.core.dao.DaoException
public void flush()
flush
in interface PhraseAnalyzerDao
public void close()
PhraseAnalyzerDao
close
in interface PhraseAnalyzerDao
Copyright © 2016. All rights reserved.