diff --git a/src/main/java/it/kamaladafrica/codicefiscale/city/impl/CityProviderImpl.java b/src/main/java/it/kamaladafrica/codicefiscale/city/impl/CityProviderImpl.java index f4625d0..fef595f 100644 --- a/src/main/java/it/kamaladafrica/codicefiscale/city/impl/CityProviderImpl.java +++ b/src/main/java/it/kamaladafrica/codicefiscale/city/impl/CityProviderImpl.java @@ -13,7 +13,7 @@ import java.util.stream.Stream; import org.apache.commons.lang3.tuple.Pair; -import org.apache.commons.text.similarity.JaroWinklerDistance; +import org.apache.commons.text.similarity.JaroWinklerSimilarity; import org.apache.commons.text.similarity.SimilarityScoreFrom; import com.google.common.collect.ImmutableList; @@ -63,7 +63,7 @@ public City findByName(String name) { result = cityByName.get(term); if (minimumMatchScore != EXACT_MATCH_SCORE && result == null) { - final SimilarityScoreFrom score = new SimilarityScoreFrom<>(new JaroWinklerDistance(), term); + final SimilarityScoreFrom score = new SimilarityScoreFrom<>(new JaroWinklerSimilarity(), term); result = cityByName.entrySet().stream().map(e -> Pair.of(e.getValue(), score.apply(e.getKey()))) .filter(e -> e.getValue() >= minimumMatchScore).max(Comparator.comparing(Entry::getValue)) .map(Entry::getKey).orElse(null);