public class LinkProbabilityDao extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LinkProbabilityDao.Provider |
Constructor and Description |
---|
LinkProbabilityDao(File path,
org.wikibrain.core.lang.Language lang,
org.wikibrain.core.dao.RawPageDao pageDao,
PhraseAnalyzerDao phraseDao) |
Modifier and Type | Method and Description |
---|---|
void |
build()
Rebuilds the link probability dao.
|
void |
buildIfNecessary()
Build the cache if it is not already built.
|
org.wikibrain.core.lang.Language |
getLang() |
double |
getLinkProbability(String mention)
Retrieves the probability a link is linked in Wikipedia.
|
double |
getLinkProbability(String mention,
boolean normalize)
Retrieves the probability a link is linked in Wikipedia.
|
boolean |
isBuilt() |
boolean |
isSubgram(String phrase,
boolean normalize) |
void |
useCache(boolean useCache)
If true, create a memory cache that stores a 64-bit hashcode for each word.
|
public LinkProbabilityDao(File path, org.wikibrain.core.lang.Language lang, org.wikibrain.core.dao.RawPageDao pageDao, PhraseAnalyzerDao phraseDao) throws org.wikibrain.core.dao.DaoException
org.wikibrain.core.dao.DaoException
public void useCache(boolean useCache)
useCache
- public void buildIfNecessary() throws org.wikibrain.core.dao.DaoException
org.wikibrain.core.dao.DaoException
public org.wikibrain.core.lang.Language getLang()
public double getLinkProbability(String mention) throws org.wikibrain.core.dao.DaoException
mention
- org.wikibrain.core.dao.DaoException
public double getLinkProbability(String mention, boolean normalize) throws org.wikibrain.core.dao.DaoException
mention
- normalize
- If true, the text is normalized.org.wikibrain.core.dao.DaoException
public void build() throws org.wikibrain.core.dao.DaoException
org.wikibrain.core.dao.DaoException
public boolean isBuilt()
public boolean isSubgram(String phrase, boolean normalize)
Copyright © 2018. All rights reserved.