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 classWikipediaUtils.CategoriesForTopicPageHandlerprotected classWikipediaUtils.ExtractsPageHandlerprotected classWikipediaUtils.PagesForTopicPageHandler
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToWordCache(List<String> tokens)booleancheckWordCache(String token)Map<String,BigDecimal>getCategoriesCache(String topic)static WikipediaUtilsgetInstance(IParameterStore parameterStore)BigDecimalgetPageviewCache(String topic)Map<String,BigDecimal>getWikipediaCategoriesForTopic(String topic)BigDecimalgetWikipediaPageviewsForTopic(String topic)StringgetWordCache(String token)voidpruneWordCache()voidputCategoryCache(String topic, Map<String,BigDecimal> score)voidputPageviewCache(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:
IOExceptionURISyntaxException
-
checkWordCache
public boolean checkWordCache(String token)
-
pruneWordCache
public void pruneWordCache()
-
-