def evaluate(tstconf): if index.has_key(tstconf): return index[tstconf] config.getProperties().clear() config.setThreshold(tstconf.get_threshold()) try: config.setProperties(ArrayList(tstconf.get_properties())) except DukeConfigException: # this means there's no way to get above the threshold in this config. # we consider that total failure, and just return. index[tstconf] = 0.0 return 0.0 testfile = TestFileListener(testfilename, config.getIdentityProperties(), False, processor, False, False) testfile.setQuiet(True) processor.getListeners().clear() processor.addMatchListener(testfile) if not linking: processor.linkRecords(config.getDataSources()) else: processor.linkRecords(config.getDataSources(2)) testfile.close() f = testfile.getFNumber() index[tstconf] = f return f
def evaluate(tstconf): if index.has_key(tstconf): return index[tstconf] config.getProperties().clear() config.setThreshold(tstconf.get_threshold()) try: config.setProperties(ArrayList(tstconf.get_properties())) except DukeConfigException: # this means there's no way to get above the threshold in this config. # we consider that total failure, and just return. index[tstconf] = 0.0 return 0.0 testfile = TestFileListener(testfilename, config, False, processor, False, True) testfile.setQuiet(True) processor.getListeners().clear() processor.addMatchListener(testfile) if not linking: processor.linkRecords(config.getDataSources()) else: processor.linkRecords(config.getDataSources(2)) f = testfile.getFNumber() index[tstconf] = f return f
def evaluate(tstconf, linkdb, pessimistic=False): # if index.has_key(tstconf): # return index[tstconf] testfile = TestFileListener(linkdb, config, False, processor, False, True) testfile.setQuiet(True) testfile.setPessimistic(pessimistic) try: run_with_config(tstconf, testfile) except DukeConfigException: # this means there's no way to get above the threshold in this config. # we consider that total failure, and just return. print "FAILED" index[tstconf] = 0.0 return 0.0 f = testfile.getFNumber() if f > 1.0: sys.exit(1) index[tstconf] = f return f
def evaluate(tstconf, linkdb, pessimistic = False): # if index.has_key(tstconf): # return index[tstconf] testfile = TestFileListener(linkdb, config, False, processor, False, True) testfile.setQuiet(True) testfile.setPessimistic(pessimistic) try: run_with_config(tstconf, testfile) except DukeConfigException: # this means there's no way to get above the threshold in this config. # we consider that total failure, and just return. print "FAILED" index[tstconf] = 0.0 return 0.0 f = testfile.getFNumber() if f > 1.0: sys.exit(1) index[tstconf] = f return f