Skip to content

Commit

Permalink
Update StringMan.java
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed May 19, 2024
1 parent 332c604 commit d4eec19
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/main/java/link/locutus/discord/util/StringMan.java
Original file line number Diff line number Diff line change
Expand Up @@ -1063,30 +1063,6 @@ public double cost(char c1, char c2) {
return (wl.distance(a, b) + s4.distance(a, b)) / 2;
}

public static void main(String[] args) {

// Test cases
String[] words1 = {"Knights Radiant", "Knights Radiant"};
String[] words2 = {"The Knights Radiant", "Knights Templar"};

Sift4 sift4 = new Sift4();
sift4.setMaxOffset(5);

for (int i = 0; i < words1.length; i++) {
double thermoSimilarity = sift4.distance(words1[i], words2[i]);;
double weighted = distanceWeightedQwertSift4(words1[i], words2[i]);
double levenshteinDistance = getLevenshteinDistance(words1[i], words2[i]);

System.out.println("Word1: " + words1[i]);
System.out.println("Word2: " + words2[i]);
System.out.println("Thermo Similarity: " + thermoSimilarity);
System.out.println("Levenshtein Distance: " + levenshteinDistance);
System.out.println("Weighted Distance: " + weighted);
System.out.println("Sift4: " + new Sift4().distance(words1[i], words2[i]));
System.out.println("-----------------------------");
}
}

public static int getLevenshteinDistance(String s, String t) {
int n = s.length();
int m = t.length();
Expand Down

0 comments on commit d4eec19

Please sign in to comment.