diff --git a/src/main/java/fr/xephi/authme/command/help/HelpPrinter.java b/src/main/java/fr/xephi/authme/command/help/HelpPrinter.java index 73948920..d3d8f78d 100644 --- a/src/main/java/fr/xephi/authme/command/help/HelpPrinter.java +++ b/src/main/java/fr/xephi/authme/command/help/HelpPrinter.java @@ -1,10 +1,10 @@ package fr.xephi.authme.command.help; import com.timvisee.dungeonmaze.Core; -import fr.xephi.authme.commands.CommandArgumentDescription; -import fr.xephi.authme.commands.CommandDescription; -import fr.xephi.authme.commands.CommandParts; -import fr.xephi.authme.commands.CommandPermissions; +import fr.xephi.authme.command.CommandArgumentDescription; +import fr.xephi.authme.command.CommandDescription; +import fr.xephi.authme.command.CommandParts; +import fr.xephi.authme.command.CommandPermissions; import com.timvisee.dungeonmaze.util.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/fr/xephi/authme/util/StringUtils.java b/src/main/java/fr/xephi/authme/util/StringUtils.java new file mode 100644 index 00000000..92b14c5c --- /dev/null +++ b/src/main/java/fr/xephi/authme/util/StringUtils.java @@ -0,0 +1,19 @@ +package fr.xephi.authme.util; + +import net.ricecode.similarity.LevenshteinDistanceStrategy; +import net.ricecode.similarity.StringSimilarityService; +import net.ricecode.similarity.StringSimilarityServiceImpl; + +public class StringUtils { + + public static double getDifference(String first, String second) { + if(first == null || second == null) + return 1.0; + + StringSimilarityService service = new StringSimilarityServiceImpl(new LevenshteinDistanceStrategy()); + + double score = service.score(first, second); + + return Math.abs(score - 1.0); + } +}