Class PairwiseDetector<T extends PairwiseDetectorWorker>
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.api.model.detection.Detector<T>
-
- uk.ac.warwick.dcs.sherlock.api.model.detection.PairwiseDetector<T>
-
- All Implemented Interfaces:
IDetector<T>
- Direct Known Subclasses:
NGramDetector,VariableNameDetector
public class PairwiseDetector<T extends PairwiseDetectorWorker> extends Detector<T>
An abstract IDetector implementation which constructs an individual, parallel worker for each combination of files in the dataset. This can be used as a base for pairwise matching algorithms.
More advanced implementations should directly implement the IDetector interface.
-
-
Constructor Summary
Constructors Constructor Description PairwiseDetector(java.lang.String displayName, java.lang.Class<T> typeArgumentClass, PreProcessingStrategy... preProcessingStrategies)IDetectorimplementation which automatically builds a worker for each possible combination of the source files passedPairwiseDetector(java.lang.String displayName, java.lang.String description, java.lang.Class<T> typeArgumentClass, PreProcessingStrategy... preProcessingStrategies)IDetectorimplementation which automatically builds a worker for each possible combination of the source files passed
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<T>buildWorkers(java.util.List<ModelDataItem> data)Builds a set of workers on a passed dataset, these workers are executed in parallel to produce the algorithm resultTgetAbstractPairwiseDetectorWorker(ModelDataItem file1Data, ModelDataItem file2Data)Fetches a new instance of the worker for this implementation-
Methods inherited from class uk.ac.warwick.dcs.sherlock.api.model.detection.Detector
getDescription, getDisplayName, getPreProcessors, setDescription
-
-
-
-
Constructor Detail
-
PairwiseDetector
public PairwiseDetector(java.lang.String displayName, java.lang.Class<T> typeArgumentClass, PreProcessingStrategy... preProcessingStrategies)IDetectorimplementation which automatically builds a worker for each possible combination of the source files passed- Parameters:
displayName- user facing display name for the detectortypeArgumentClass- class object for the generic type of this detector's workerpreProcessingStrategies- preprocessing strategies to use for this detector, can be one of many.
-
PairwiseDetector
public PairwiseDetector(java.lang.String displayName, java.lang.String description, java.lang.Class<T> typeArgumentClass, PreProcessingStrategy... preProcessingStrategies)IDetectorimplementation which automatically builds a worker for each possible combination of the source files passed- Parameters:
displayName- user facing display name for the detectordescription- user facing description for the detectortypeArgumentClass- class object for the generic type of this detector's workerpreProcessingStrategies- preprocessing strategies to use for this detector, can be one of many.
-
-
Method Detail
-
buildWorkers
public final java.util.List<T> buildWorkers(java.util.List<ModelDataItem> data)
Builds a set of workers on a passed dataset, these workers are executed in parallel to produce the algorithm result- Specified by:
buildWorkersin interfaceIDetector<T extends PairwiseDetectorWorker>- Specified by:
buildWorkersin classDetector<T extends PairwiseDetectorWorker>- Parameters:
data- preprocessed dataset- Returns:
- list of configured workers ready to be executed
-
getAbstractPairwiseDetectorWorker
public T getAbstractPairwiseDetectorWorker(ModelDataItem file1Data, ModelDataItem file2Data)
Fetches a new instance of the worker for this implementation- Parameters:
file1Data- ModelDataItem for file 1file2Data- ModelFataItem for file 2- Returns:
- the new worker instance
-
-