Package it.freedomotic.util

Examples of it.freedomotic.util.DamerauLevenshtein


        }
        for (Command command : CommandPersistence.getUserCommands()) {
            int similarity = 0;
            for (String inputTag : Arrays.asList(input.split(" "))) {
                for (String commandTag : command.getTags()) {
                    DamerauLevenshtein algorithm = new DamerauLevenshtein(inputTag.trim().toLowerCase(), commandTag.trim().toLowerCase());
                    int distance = algorithm.getSimilarity();
                    //the percent of similarity in in this tag related to input tag
                    double percent = ((double) (distance * 100)) / ((double) inputTag.length());

                    if (distance == 0) {
                        similarity += 3;
View Full Code Here

TOP

Related Classes of it.freedomotic.util.DamerauLevenshtein

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.