code: public static double similarLevenshtein(String s1, String s2) {
          if (s1.equals(s2)) {
              return 1.0;
          }
  
          // Make sure s1 is the longest string
          if (s1.length() < s2.length()) {
              String swap = s1;
              s1 = s2;
              s2 = swap;
          }
  
          int bigLength = s1.length();
          return (bigLength - StringUtils.getLevenshteinDistance(s2, s1)) / (double) bigLength;
      }
docs: Checks to see how similar two strings are using the Levenshtein distance algorithm.
  
  @param s1 The first string to compare against.
  @param s2 The second string to compare against.
  @return A value between 0 and 1.0, where 1.0 is an exact match and 0 is no match at all.