Skip to content

Commit

Permalink
Return false for lossy regex on Lc normalizers for now
Browse files Browse the repository at this point in the history
  • Loading branch information
ivakegg committed Oct 4, 2024
1 parent 8d18742 commit 07da00a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ public String normalizeRegex(String fieldRegex) {

@Override
public boolean normalizedRegexIsLossy(String regex) {
Matcher diacriticMatcher = diacriticals.matcher(regex);
Matcher captialMatcher = capitals.matcher(regex);

return (diacriticMatcher.matches() || captialMatcher.matches());
// Despite this normalizer actually being lossy, we are still
// returning false as users are used to overmathing when including
// diacritics or upper case letter. We may consider changing this
// down the road, but for not returning false.
return false;
}

@Override
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/datawave/data/normalizer/LcNormalizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ public String normalizeRegex(String fieldRegex) {
}
}

@Override
public boolean normalizedRegexIsLossy(String regex) {
// Despite this normalizer actually being lossy, we are still
// returning false as users are used to overmathing when including
// diacritics or upper case letter. We may consider changing this
// down the road, but for not returning false.
return false;
}

@Override
public String normalizeDelegateType(String delegateIn) {
return normalize(delegateIn);
Expand Down

0 comments on commit 07da00a

Please sign in to comment.