Package com.sk89q.worldedit.util.function

Examples of com.sk89q.worldedit.util.function.LevenshteinDistance


    public static BaseBiome findBiomeByName(Collection<BaseBiome> biomes, String name, BiomeRegistry registry) {
        checkNotNull(biomes);
        checkNotNull(name);
        checkNotNull(registry);

        Function<String, ? extends Number> compare = new LevenshteinDistance(name, false, LevenshteinDistance.STANDARD_CHARS);
        WeightedChoice<BaseBiome> chooser = new WeightedChoice<BaseBiome>(Functions.compose(compare, new BiomeName(registry)), 0);
        for (BaseBiome biome : biomes) {
            chooser.consider(biome);
        }
        Optional<Choice<BaseBiome>> choice = chooser.getChoice();
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.util.function.LevenshteinDistance

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.