Package io.outofprintmagazine.nlp.utils
Class WikipediaUtils
- java.lang.Object
-
- io.outofprintmagazine.nlp.utils.WikipediaUtils
-
public class WikipediaUtils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
WikipediaUtils.CategoriesForTopicPageHandler
protected class
WikipediaUtils.ExtractsPageHandler
protected class
WikipediaUtils.PagesForTopicPageHandler
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToWordCache(List<String> tokens)
boolean
checkWordCache(String token)
Map<String,BigDecimal>
getCategoriesCache(String topic)
static WikipediaUtils
getInstance(IParameterStore parameterStore)
BigDecimal
getPageviewCache(String topic)
Map<String,BigDecimal>
getWikipediaCategoriesForTopic(String topic)
BigDecimal
getWikipediaPageviewsForTopic(String topic)
String
getWordCache(String token)
void
pruneWordCache()
void
putCategoryCache(String topic, Map<String,BigDecimal> score)
void
putPageviewCache(String topic, BigDecimal score)
-
-
-
Method Detail
-
getPageviewCache
public BigDecimal getPageviewCache(String topic)
-
putPageviewCache
public void putPageviewCache(String topic, BigDecimal score)
-
getCategoriesCache
public Map<String,BigDecimal> getCategoriesCache(String topic)
-
putCategoryCache
public void putCategoryCache(String topic, Map<String,BigDecimal> score)
-
getInstance
public static WikipediaUtils getInstance(IParameterStore parameterStore) throws IOException
- Throws:
IOException
-
getWikipediaPageviewsForTopic
public BigDecimal getWikipediaPageviewsForTopic(String topic) throws MalformedURLException, UnsupportedEncodingException, IOException, URISyntaxException
-
getWikipediaCategoriesForTopic
public Map<String,BigDecimal> getWikipediaCategoriesForTopic(String topic) throws IOException, URISyntaxException
- Throws:
IOException
URISyntaxException
-
checkWordCache
public boolean checkWordCache(String token)
-
pruneWordCache
public void pruneWordCache()
-
-