Skip to content

Commit

Permalink
Rename NewSimilarityUtils to WordSimUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
kwerber committed May 17, 2022
1 parent b9de927 commit 251eb08
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Licensed under MIT 2022. */
package edu.kit.kastel.mcse.ardoco.core.tests.integration.tracelinks.eval;

import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.NewSimilarityUtils;
import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimUtils;
import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.deletelater.ComparisonStats;
import edu.kit.kastel.mcse.ardoco.core.pipeline.Pipeline;
import edu.kit.kastel.mcse.ardoco.core.tests.Project;
Expand Down Expand Up @@ -88,7 +88,7 @@ public void execute() throws IOException {

private EvalPlanResult evaluatePlan(EvalPlan plan) throws IOException {
ComparisonStats.ENABLED = false;
NewSimilarityUtils.setMeasures(plan.getMeasures());
WordSimUtils.setMeasures(plan.getMeasures());

var projectResults = new ArrayList<EvalProjectResult>();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Licensed under MIT 2021-2022. */
package edu.kit.kastel.mcse.ardoco.core.common.util;

import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.NewSimilarityUtils;
import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimUtils;
import edu.kit.kastel.mcse.ardoco.core.model.IModelInstance;
import edu.kit.kastel.mcse.ardoco.core.recommendationgenerator.IRecommendedInstance;
import edu.kit.kastel.mcse.ardoco.core.text.IWord;
Expand Down Expand Up @@ -144,7 +144,7 @@ public static boolean areWordsSimilar(IWord word1, IWord word2) {
var word1Text = word1.getText();
var word2Text = word2.getText();
//return areWordsSimilar(word1Text, word2Text);
return NewSimilarityUtils.areWordsSimilar(word1, word2);
return WordSimUtils.areWordsSimilar(word1, word2);
}

/**
Expand Down Expand Up @@ -172,7 +172,7 @@ private static boolean areWordsSimilar(String original, String word2test, double
//var isJaroWinklerSimilar = jaroWinklerSimilarityTest(original, word2test, similarityThreshold);
//return isJaroWinklerSimilar || isLevenshteinSimilar;

return NewSimilarityUtils.areWordsSimilar(original, word2test);
return WordSimUtils.areWordsSimilar(original, word2test);
}

private static boolean jaroWinklerSimilarityTest(String original, String word2test, Double threshold) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
/**
* A static class that provides various utility methods to calculate similarity between different kinds of objects.
*/
public class NewSimilarityUtils {
public class WordSimUtils {

private static List<WordSimMeasure> MEASURES = WordSimLoader.loadUsingProperties();
private static ComparisonStrategy STRATEGY = ComparisonStrategy.AT_LEAST_ONE; // TODO: load default from properties?
private static ComparisonStrategy STRATEGY = ComparisonStrategy.AT_LEAST_ONE;

public static void setMeasures(Collection<WordSimMeasure> measures) { MEASURES = new ArrayList<>(measures); }

Expand Down Expand Up @@ -57,7 +57,7 @@ public static boolean areWordsSimilar(String firstWord, IWord secondWord, Compar
return areWordsSimilar(new ComparisonContext(firstWord, secondWord.getText(), null, secondWord, false), strategy);
}

private NewSimilarityUtils() {
private WordSimUtils() {
}

}

0 comments on commit 251eb08

Please sign in to comment.