use of org.opensextant.extraction.Extractor in project Xponents by OpenSextant.
the class XtractorGroup method process.
/**
* Process one input. If you have no need for formatting output at this time
* use this. If you have complext ExtractionResults where you want to add
* meta attributes, then you would use this approach
*/
public List<TextMatch> process(TextInput input) {
List<TextMatch> oneResultSet = new ArrayList<TextMatch>();
progressMonitor.setNumberOfSteps(extractors.size());
/**
* Process all extraction and compile on a single list.
*/
for (Extractor x : extractors) {
try {
List<TextMatch> results = x.extract(input);
if (results != null && !results.isEmpty()) {
oneResultSet.addAll(results);
}
} catch (ExtractionException loopErr) {
log.error("Extractor=" + x.getName() + "on Input=" + input.id, loopErr);
currErrors.add("Extractor=" + x.getName() + " ERR=" + loopErr.getMessage());
}
}
progressMonitor.completeDocument();
return oneResultSet;
}
use of org.opensextant.extraction.Extractor in project Xponents by OpenSextant.
the class XponentsGeotagger method stop.
/**
* Must explicitly stop Solr multi-threading.
*/
@Override
public void stop() {
Extractor x = getExtractor();
if (x != null) {
x.cleanup();
}
System.exit(0);
}
Aggregations