-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix infinite recursion in SimilarityMeasure (#19)
* Add test case and bug fix * Add UnknownSimilarityMeasure class
- Loading branch information
1 parent
1c4eb25
commit bf0734b
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
core/src/main/java/com/bakdata/dedupe/similarity/UnknownSimilarityMeasure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.bakdata.dedupe.similarity; | ||
|
||
import lombok.NonNull; | ||
|
||
class UnknownSimilarityMeasure<T> implements SimilarityMeasure<T> { | ||
@Override | ||
public double getSimilarity(final Object left, final Object right, final @NonNull SimilarityContext context) { | ||
return SimilarityMeasure.unknown(); | ||
} | ||
|
||
@Override | ||
public double getNonNullSimilarity(final @NonNull Object left, final @NonNull Object right, | ||
final @NonNull SimilarityContext context) { | ||
return SimilarityMeasure.unknown(); | ||
} | ||
} |