try {
//long tm1 = Calendar.getInstance().getTimeInMillis();
map = MapBuilder.fromXmlFile(config.getNameMapFilename());
//System.err.format("Loading map took %d ms\n", (Calendar.getInstance().getTimeInMillis()-tm1));
} catch (Exception e) {
throw new GoldifyException(String.format("Could not load the terms from XML file '%s'\n", config.getNameMapFilename()));
}
TextMarker tm;
try {
tm = new TextMarker(map, config.getExcludedTerms());
} catch (Exception e) {
throw new GoldifyException(String.format("Could not load the list of excluded terms from XML file '%s'\n", config.getExcludedTermsFilename()));
}
UrlBuilder ub = config.createUrlBuilder();
DocumentProcessorManager dpm = new DocumentProcessorManager();
dpm.registerProcessor("txt", new PlainTextProcessor(tm,ub,config.getTxtLinkTemplate()));
dpm.registerProcessor("html", new HtmlProcessor(tm,ub,config.getHtmlLinkTemplate(),config.getHtmlForbiddenTags()));