* @param catName
* @throws IOException
*/
public void calculate(String catName) throws IOException{
loadIncludedNotIncludedUrls(catName);
BayesCalculator calculator= new BayesCalculator(config.getBaseDir(), catName, cfg, maxTuple);
for (String url: includedUrlsList){
String item=cache.getItem(url);
if (null==item){
LOGGER.warn("Page " + url + "is in included for " + catName + " but not in cache");
continue;
}
calculator.addData(DocumentParser.parse(item, maxTuple),true, url);
}
for (String url: notIncludedUrlsList){
String item=cache.getItem(url);
if (null==item){
LOGGER.warn("Page " + url + "is in notIncluded for " + catName + " but not in cache");
continue;
}
calculator.addData(DocumentParser.parse(item, maxTuple),false, url);
}
calculator.computeProbabilities(); //and save the .probabilities to disk
}