Ticket #17588: 17588_levenshteindistance.patch

File 17588_levenshteindistance.patch, 1.4 KB (added by taylor.smock, 7 years ago)

Replace deprecated functions (SimilarNamedWays.getLevenshteinDistance was deprecated in #14373)

  • build.properties

     
    1313
    1414# the lowest JOSM version the curent plugin version is compatible with
    1515#
    16 josm.required.version=14153
     16josm.required.version=14371
    1717
    1818# the full path to the JOSM jar against which this plugin is built
    1919#
  • src/org/openstreetmap/josm/plugins/conflation/matcher/LevenshteinDistanceValueMatcher.java

     
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.conflation.matcher;
    33
    4 import org.openstreetmap.josm.data.validation.tests.SimilarNamedWays;
     4import org.openstreetmap.josm.tools.Utils;
    55
    66public class LevenshteinDistanceValueMatcher implements ValueMatcher {
    77
     
    2323        if (maxLength == 0)
    2424            return 1.0;
    2525        double divider = (distanceThreshold > 0) ? distanceThreshold : maxLength;
    26         return Math.max(0.0, 1.0 - ((double) SimilarNamedWays.getLevenshteinDistance(target, candidate) / divider));
     26        return Math.max(0.0, 1.0 - ((double) Utils.getLevenshteinDistance(target, candidate) / divider));
    2727    }
    2828}