From 3e74f001be34cffbb3a2c81543a543928a74d31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Fuch=C3=9F?= Date: Fri, 29 Nov 2024 20:38:21 +0100 Subject: [PATCH] Move packages for similarity --- .../PhraseMappingAggregatorStrategy.java | 6 +++--- .../{util => similarity}/SimilarityComparable.java | 2 +- .../common/{util => similarity}/SimilarityUtils.java | 6 ++++-- .../wordsim/ComparisonContext.java | 2 +- .../wordsim/ConfusablesHelper.java | 2 +- .../wordsim/UnicodeCharacter.java | 2 +- .../wordsim/UnicodeCharacterMatchFunctions.java | 2 +- .../wordsim/UnicodeCharacterSequence.java | 2 +- .../{util => similarity}/wordsim/WordSimLoader.java | 12 ++++++------ .../{util => similarity}/wordsim/WordSimMeasure.java | 2 +- .../{util => similarity}/wordsim/WordSimUtils.java | 10 +++++----- .../wordsim/measures/equality/EqualityMeasure.java | 8 ++++---- .../wordsim/measures/glove/GloveMeasure.java | 12 ++++++------ .../measures/jarowinkler/JaroWinklerMeasure.java | 6 +++--- .../jarowinkler/UnicodeJaroWinklerSimilarity.java | 8 ++++---- .../measures/levenshtein/LevenshteinMeasure.java | 8 ++++---- .../levenshtein/UnicodeLevenshteinDistance.java | 8 ++++---- .../wordsim/measures/ngram/NgramMeasure.java | 6 +++--- .../measures/sewordsim/SEWordSimDataSource.java | 4 ++-- .../wordsim/measures/sewordsim/SEWordSimMeasure.java | 6 +++--- .../wordsim/strategy/AtLeastOneStrategy.java | 6 +++--- .../wordsim/strategy/AverageStrategy.java | 6 +++--- .../wordsim/strategy/ComparisonStrategy.java | 6 +++--- .../wordsim/strategy/MajorityStrategy.java | 6 +++--- .../wordsim/strategy/MaximumStrategy.java | 6 +++--- .../wordsim/strategy/MedianStrategy.java | 6 +++--- .../wordsim/strategy/SimilarityStrategy.java | 6 +++--- .../wordsim/vector/RetrieveVectorException.java | 2 +- .../wordsim/vector/VectorBasedWordSimMeasure.java | 4 ++-- .../wordsim/vector/VectorSqliteDatabase.java | 4 ++-- .../wordsim/vector/VectorUtils.java | 2 +- .../wordsim/vector/WordVectorDataSource.java | 2 +- .../wordsim/vector/WordVectorSqliteImporter.java | 2 +- .../ardoco/core/common/util/CommonUtilities.java | 1 + .../core/common/util/DataRepositoryHelper.java | 1 + .../mcse/ardoco/core/data/GlobalConfiguration.java | 4 ++-- .../wordsim/ConfusablesHelperTest.java | 5 ++++- .../wordsim/WordSimUtilsTest.java | 4 +++- .../measures/jarowinkler/JaroWinklerMeasureTest.java | 8 +++++--- .../measures/levenshtein/LevenshteinMeasureTest.java | 8 +++++--- .../wordsim/measures/ngram/NgramMeasureTest.java | 5 +++-- .../wordsim/vector/VectorUtilsTest.java | 4 +++- 42 files changed, 114 insertions(+), 98 deletions(-) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/PhraseMappingAggregatorStrategy.java (87%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/SimilarityComparable.java (96%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/SimilarityUtils.java (98%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/ComparisonContext.java (98%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/ConfusablesHelper.java (98%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/UnicodeCharacter.java (97%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/UnicodeCharacterMatchFunctions.java (93%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/UnicodeCharacterSequence.java (96%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/WordSimLoader.java (74%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/WordSimMeasure.java (91%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/WordSimUtils.java (95%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/equality/EqualityMeasure.java (72%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/glove/GloveMeasure.java (80%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/jarowinkler/JaroWinklerMeasure.java (85%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/jarowinkler/UnicodeJaroWinklerSimilarity.java (95%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/levenshtein/LevenshteinMeasure.java (91%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/levenshtein/UnicodeLevenshteinDistance.java (97%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/ngram/NgramMeasure.java (95%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/sewordsim/SEWordSimDataSource.java (96%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/sewordsim/SEWordSimMeasure.java (90%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/strategy/AtLeastOneStrategy.java (70%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/strategy/AverageStrategy.java (70%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/strategy/ComparisonStrategy.java (77%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/strategy/MajorityStrategy.java (72%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/strategy/MaximumStrategy.java (67%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/strategy/MedianStrategy.java (76%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/strategy/SimilarityStrategy.java (69%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/vector/RetrieveVectorException.java (79%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/vector/VectorBasedWordSimMeasure.java (93%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/vector/VectorSqliteDatabase.java (95%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/vector/VectorUtils.java (98%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/vector/WordVectorDataSource.java (89%) rename framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/vector/WordVectorSqliteImporter.java (99%) rename framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/ConfusablesHelperTest.java (83%) rename framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/WordSimUtilsTest.java (79%) rename framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/jarowinkler/JaroWinklerMeasureTest.java (87%) rename framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/levenshtein/LevenshteinMeasureTest.java (79%) rename framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/measures/ngram/NgramMeasureTest.java (93%) rename framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/{util => similarity}/wordsim/vector/VectorUtilsTest.java (96%) diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/PhraseMappingAggregatorStrategy.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/PhraseMappingAggregatorStrategy.java similarity index 87% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/PhraseMappingAggregatorStrategy.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/PhraseMappingAggregatorStrategy.java index 4f2fd412c..f91f8956d 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/PhraseMappingAggregatorStrategy.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/PhraseMappingAggregatorStrategy.java @@ -1,8 +1,8 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util; +package edu.kit.kastel.mcse.ardoco.core.common.similarity; -import static edu.kit.kastel.mcse.ardoco.core.common.util.SimilarityUtils.cosineSimilarity; -import static edu.kit.kastel.mcse.ardoco.core.common.util.SimilarityUtils.uniqueDot; +import static edu.kit.kastel.mcse.ardoco.core.common.similarity.SimilarityUtils.cosineSimilarity; +import static edu.kit.kastel.mcse.ardoco.core.common.similarity.SimilarityUtils.uniqueDot; import java.util.function.ToDoubleBiFunction; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/SimilarityComparable.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/SimilarityComparable.java similarity index 96% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/SimilarityComparable.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/SimilarityComparable.java index 07785056e..6b7d97807 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/SimilarityComparable.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/SimilarityComparable.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util; +package edu.kit.kastel.mcse.ardoco.core.common.similarity; import java.util.Collection; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/SimilarityUtils.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/SimilarityUtils.java similarity index 98% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/SimilarityUtils.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/SimilarityUtils.java index 797166686..21537fbb9 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/SimilarityUtils.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/SimilarityUtils.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2021-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util; +package edu.kit.kastel.mcse.ardoco.core.common.similarity; import java.io.Serializable; import java.util.ArrayList; @@ -21,8 +21,10 @@ import edu.kit.kastel.mcse.ardoco.core.api.text.PhraseType; import edu.kit.kastel.mcse.ardoco.core.api.text.Word; import edu.kit.kastel.mcse.ardoco.core.architecture.Deterministic; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimUtils; import edu.kit.kastel.mcse.ardoco.core.common.tuple.Pair; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimUtils; +import edu.kit.kastel.mcse.ardoco.core.common.util.CommonTextToolsConfig; +import edu.kit.kastel.mcse.ardoco.core.common.util.CommonUtilities; /** * This class is a utility class. diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/ComparisonContext.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/ComparisonContext.java similarity index 98% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/ComparisonContext.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/ComparisonContext.java index 519aebfe2..12344ce71 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/ComparisonContext.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/ComparisonContext.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim; import java.util.Objects; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/ConfusablesHelper.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/ConfusablesHelper.java similarity index 98% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/ConfusablesHelper.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/ConfusablesHelper.java index 2ad3fe169..fbed802c7 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/ConfusablesHelper.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/ConfusablesHelper.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim; import java.io.BufferedReader; import java.io.File; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/UnicodeCharacter.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/UnicodeCharacter.java similarity index 97% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/UnicodeCharacter.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/UnicodeCharacter.java index 940cf1e32..15b307744 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/UnicodeCharacter.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/UnicodeCharacter.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim; import java.io.Serializable; import java.util.Arrays; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/UnicodeCharacterMatchFunctions.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/UnicodeCharacterMatchFunctions.java similarity index 93% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/UnicodeCharacterMatchFunctions.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/UnicodeCharacterMatchFunctions.java index 4bb407417..76b181f7b 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/UnicodeCharacterMatchFunctions.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/UnicodeCharacterMatchFunctions.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim; import java.io.Serializable; import java.util.function.BiFunction; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/UnicodeCharacterSequence.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/UnicodeCharacterSequence.java similarity index 96% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/UnicodeCharacterSequence.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/UnicodeCharacterSequence.java index 44560fbb3..b764508a3 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/UnicodeCharacterSequence.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/UnicodeCharacterSequence.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim; import java.util.Objects; import java.util.stream.IntStream; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimLoader.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimLoader.java similarity index 74% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimLoader.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimLoader.java index 405dde414..7a39d29bd 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimLoader.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimLoader.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2023. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim; import java.util.ArrayList; @@ -8,12 +8,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.equality.EqualityMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.jarowinkler.JaroWinklerMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.levenshtein.LevenshteinMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.ngram.NgramMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.sewordsim.SEWordSimMeasure; import edu.kit.kastel.mcse.ardoco.core.common.util.CommonTextToolsConfig; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.equality.EqualityMeasure; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.jarowinkler.JaroWinklerMeasure; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.levenshtein.LevenshteinMeasure; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.ngram.NgramMeasure; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.sewordsim.SEWordSimMeasure; /** * Responsible for loading the word similarity measures that should be enabled according to the diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimMeasure.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimMeasure.java similarity index 91% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimMeasure.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimMeasure.java index 5e461ebc1..97ca8f0cb 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimMeasure.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimMeasure.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim; import java.io.Serializable; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimUtils.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimUtils.java similarity index 95% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimUtils.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimUtils.java index 98594242b..5413c6955 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimUtils.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimUtils.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim; import java.io.Serializable; import java.util.ArrayList; @@ -13,10 +13,10 @@ import org.sqlite.SQLiteOpenMode; import edu.kit.kastel.mcse.ardoco.core.api.text.Word; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.equality.EqualityMeasure; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.strategy.AverageStrategy; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.strategy.ComparisonStrategy; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.strategy.SimilarityStrategy; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.equality.EqualityMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.strategy.AverageStrategy; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.strategy.ComparisonStrategy; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.strategy.SimilarityStrategy; /** * A static class that provides various utility methods to calculate similarity between different kinds of objects. This class statically keeps a reference to a diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/equality/EqualityMeasure.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/equality/EqualityMeasure.java similarity index 72% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/equality/EqualityMeasure.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/equality/EqualityMeasure.java index 33b4003e3..52e6b53f5 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/equality/EqualityMeasure.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/equality/EqualityMeasure.java @@ -1,11 +1,11 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.equality; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.equality; import java.util.Locale; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.UnicodeCharacterSequence; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacterSequence; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; /** * This word similarity measure just checks whether the most appropriate string representations of the passed objects are equal. diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/glove/GloveMeasure.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/glove/GloveMeasure.java similarity index 80% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/glove/GloveMeasure.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/glove/GloveMeasure.java index 9346f5d0c..af97c7d9c 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/glove/GloveMeasure.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/glove/GloveMeasure.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.glove; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.glove; import java.nio.file.Path; import java.sql.SQLException; @@ -7,12 +7,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector.RetrieveVectorException; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector.VectorBasedWordSimMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector.VectorSqliteDatabase; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector.WordVectorDataSource; import edu.kit.kastel.mcse.ardoco.core.common.util.CommonTextToolsConfig; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector.RetrieveVectorException; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector.VectorBasedWordSimMeasure; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector.VectorSqliteDatabase; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector.WordVectorDataSource; /** * This word similarity measures utilizes GloVe trained word vector representations to calculate word similarity. It retrieves vectors for each word and diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/jarowinkler/JaroWinklerMeasure.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/jarowinkler/JaroWinklerMeasure.java similarity index 85% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/jarowinkler/JaroWinklerMeasure.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/jarowinkler/JaroWinklerMeasure.java index 47d1d59cd..df864bddf 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/jarowinkler/JaroWinklerMeasure.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/jarowinkler/JaroWinklerMeasure.java @@ -1,9 +1,9 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.jarowinkler; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.jarowinkler; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; import edu.kit.kastel.mcse.ardoco.core.common.util.CommonTextToolsConfig; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; /** * This word similarity measure uses the jaro winkler algorithm to calculate similarity. diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/jarowinkler/UnicodeJaroWinklerSimilarity.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/jarowinkler/UnicodeJaroWinklerSimilarity.java similarity index 95% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/jarowinkler/UnicodeJaroWinklerSimilarity.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/jarowinkler/UnicodeJaroWinklerSimilarity.java index 7ddcb493f..a8d6aa6a4 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/jarowinkler/UnicodeJaroWinklerSimilarity.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/jarowinkler/UnicodeJaroWinklerSimilarity.java @@ -1,12 +1,12 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.jarowinkler; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.jarowinkler; import java.io.Serializable; import java.util.Arrays; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.UnicodeCharacter; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.UnicodeCharacterMatchFunctions; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.UnicodeCharacterSequence; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacter; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacterMatchFunctions; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacterSequence; /** * A similarity algorithm indicating the percentage of matched characters between two character sequences. diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/levenshtein/LevenshteinMeasure.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/levenshtein/LevenshteinMeasure.java similarity index 91% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/levenshtein/LevenshteinMeasure.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/levenshtein/LevenshteinMeasure.java index dc6195d00..a30f1f7c5 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/levenshtein/LevenshteinMeasure.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/levenshtein/LevenshteinMeasure.java @@ -1,10 +1,10 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.levenshtein; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.levenshtein; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacterSequence; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; import edu.kit.kastel.mcse.ardoco.core.common.util.CommonTextToolsConfig; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.UnicodeCharacterSequence; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; /** * This word similarity measure uses the levenshtein distance (also sometimes called edit distance) algorithm to calculate word similarity. This measure is diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/levenshtein/UnicodeLevenshteinDistance.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/levenshtein/UnicodeLevenshteinDistance.java similarity index 97% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/levenshtein/UnicodeLevenshteinDistance.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/levenshtein/UnicodeLevenshteinDistance.java index 173fc5d73..111d5401e 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/levenshtein/UnicodeLevenshteinDistance.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/levenshtein/UnicodeLevenshteinDistance.java @@ -1,14 +1,14 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.levenshtein; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.levenshtein; import java.io.Serializable; import java.util.Arrays; import org.apache.commons.text.similarity.LevenshteinDistance; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.UnicodeCharacter; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.UnicodeCharacterMatchFunctions; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.UnicodeCharacterSequence; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacter; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacterMatchFunctions; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacterSequence; /** * An algorithm for measuring the difference between two character sequences. diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/ngram/NgramMeasure.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/ngram/NgramMeasure.java similarity index 95% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/ngram/NgramMeasure.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/ngram/NgramMeasure.java index a0d365398..062db285e 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/ngram/NgramMeasure.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/ngram/NgramMeasure.java @@ -1,11 +1,11 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.ngram; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.ngram; import java.util.Objects; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; import edu.kit.kastel.mcse.ardoco.core.common.util.CommonTextToolsConfig; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; /** * This word similarity measure uses the N-gram word distance function defined by Kondrak 2005. diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/sewordsim/SEWordSimDataSource.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/sewordsim/SEWordSimDataSource.java similarity index 96% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/sewordsim/SEWordSimDataSource.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/sewordsim/SEWordSimDataSource.java index 37a2ed8eb..9b4240685 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/sewordsim/SEWordSimDataSource.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/sewordsim/SEWordSimDataSource.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2023. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.sewordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.sewordsim; import java.nio.file.Files; import java.nio.file.Path; @@ -13,7 +13,7 @@ import org.sqlite.SQLiteConfig; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimUtils; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimUtils; import opennlp.tools.stemmer.PorterStemmer; /** diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/sewordsim/SEWordSimMeasure.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/sewordsim/SEWordSimMeasure.java similarity index 90% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/sewordsim/SEWordSimMeasure.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/sewordsim/SEWordSimMeasure.java index 8f9e5e813..aa2afb353 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/sewordsim/SEWordSimMeasure.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/sewordsim/SEWordSimMeasure.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.sewordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.sewordsim; import java.nio.file.Path; import java.sql.SQLException; @@ -7,9 +7,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; import edu.kit.kastel.mcse.ardoco.core.common.util.CommonTextToolsConfig; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; /** * This word similarity measures utilizes the SEWordSim database from Tian et al. 2014 diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/AtLeastOneStrategy.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/AtLeastOneStrategy.java similarity index 70% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/AtLeastOneStrategy.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/AtLeastOneStrategy.java index 0beeb0600..7b1e7dffa 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/AtLeastOneStrategy.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/AtLeastOneStrategy.java @@ -1,10 +1,10 @@ /* Licensed under MIT 2022-2023. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.strategy; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.strategy; import java.util.List; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; /** * This comparison strategy accepts any word pair as similar if at least one of the specified word similarity measures diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/AverageStrategy.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/AverageStrategy.java similarity index 70% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/AverageStrategy.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/AverageStrategy.java index 7f0c5fb3d..0deb79528 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/AverageStrategy.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/AverageStrategy.java @@ -1,10 +1,10 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.strategy; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.strategy; import java.util.List; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; public class AverageStrategy implements SimilarityStrategy { @Override diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/ComparisonStrategy.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/ComparisonStrategy.java similarity index 77% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/ComparisonStrategy.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/ComparisonStrategy.java index b32c55f20..8318b0e85 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/ComparisonStrategy.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/ComparisonStrategy.java @@ -1,11 +1,11 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.strategy; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.strategy; import java.io.Serializable; import java.util.List; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; /** * A comparison strategy determines how the verdicts of multiple WSMs regarding a specific comparison are combined. diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/MajorityStrategy.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/MajorityStrategy.java similarity index 72% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/MajorityStrategy.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/MajorityStrategy.java index 98972731e..029cca99e 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/MajorityStrategy.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/MajorityStrategy.java @@ -1,10 +1,10 @@ /* Licensed under MIT 2022-2023. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.strategy; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.strategy; import java.util.List; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; /** * This comparison strategy accepts any word pair as similar if the majority of specified word similarity measures diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/MaximumStrategy.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/MaximumStrategy.java similarity index 67% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/MaximumStrategy.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/MaximumStrategy.java index ee7efe0bf..2c9c6916a 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/MaximumStrategy.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/MaximumStrategy.java @@ -1,10 +1,10 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.strategy; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.strategy; import java.util.List; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; public class MaximumStrategy implements SimilarityStrategy { @Override diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/MedianStrategy.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/MedianStrategy.java similarity index 76% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/MedianStrategy.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/MedianStrategy.java index 15859a20c..1380e98fe 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/MedianStrategy.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/MedianStrategy.java @@ -1,11 +1,11 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.strategy; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.strategy; import java.util.ArrayList; import java.util.List; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; public class MedianStrategy implements SimilarityStrategy { @Override diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/SimilarityStrategy.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/SimilarityStrategy.java similarity index 69% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/SimilarityStrategy.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/SimilarityStrategy.java index 4449faa54..6ea267b32 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/strategy/SimilarityStrategy.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/strategy/SimilarityStrategy.java @@ -1,11 +1,11 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.strategy; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.strategy; import java.io.Serializable; import java.util.List; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; public interface SimilarityStrategy extends Serializable { /** diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/RetrieveVectorException.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/RetrieveVectorException.java similarity index 79% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/RetrieveVectorException.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/RetrieveVectorException.java index 70857f9c6..6770d891a 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/RetrieveVectorException.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/RetrieveVectorException.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2023. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector; /** * An exception that can occur while trying to retrieve a vector. diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorBasedWordSimMeasure.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorBasedWordSimMeasure.java similarity index 93% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorBasedWordSimMeasure.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorBasedWordSimMeasure.java index 23e407698..ce02a0dee 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorBasedWordSimMeasure.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorBasedWordSimMeasure.java @@ -1,12 +1,12 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector; import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; import edu.kit.kastel.mcse.ardoco.core.architecture.Deterministic; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimMeasure; /** * A vector based word similarity measure uses vector embeddings of words to compare their similarity. To get vector diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorSqliteDatabase.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorSqliteDatabase.java similarity index 95% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorSqliteDatabase.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorSqliteDatabase.java index fd6e7af7f..453c9980b 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorSqliteDatabase.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorSqliteDatabase.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2023. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector; import java.nio.ByteBuffer; import java.nio.file.Files; @@ -12,7 +12,7 @@ import org.sqlite.SQLiteConfig; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimUtils; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimUtils; /** * Manages a connection to a sqlite database that contains vector word embeddings using a very specific schema: diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorUtils.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorUtils.java similarity index 98% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorUtils.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorUtils.java index a8f7cbbf8..e8ceb8a26 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorUtils.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorUtils.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2023. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector; import java.util.Objects; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/WordVectorDataSource.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/WordVectorDataSource.java similarity index 89% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/WordVectorDataSource.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/WordVectorDataSource.java index 40240454a..ec998ee47 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/WordVectorDataSource.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/WordVectorDataSource.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2023. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector; import java.util.Optional; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/WordVectorSqliteImporter.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/WordVectorSqliteImporter.java similarity index 99% rename from framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/WordVectorSqliteImporter.java rename to framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/WordVectorSqliteImporter.java index 85e7b9024..7b637afef 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/WordVectorSqliteImporter.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/WordVectorSqliteImporter.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector; import java.io.BufferedReader; import java.io.IOException; diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/CommonUtilities.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/CommonUtilities.java index a0b308f2b..8ff96c197 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/CommonUtilities.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/CommonUtilities.java @@ -28,6 +28,7 @@ import edu.kit.kastel.mcse.ardoco.core.api.stage.textextraction.NounMapping; import edu.kit.kastel.mcse.ardoco.core.api.text.DependencyTag; import edu.kit.kastel.mcse.ardoco.core.api.text.Word; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.SimilarityUtils; import edu.kit.kastel.mcse.ardoco.core.pipeline.agent.Claimant; /** diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/DataRepositoryHelper.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/DataRepositoryHelper.java index e11fd94da..e06a54120 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/DataRepositoryHelper.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/common/util/DataRepositoryHelper.java @@ -247,6 +247,7 @@ public static void putPreprocessingData(DataRepository dataRepository, Preproces * * @param object the object to copy */ + @SuppressWarnings("unchecked") public static T deepCopy(T object) { try { var byteArrayOutputStream = new ByteArrayOutputStream(); diff --git a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/data/GlobalConfiguration.java b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/data/GlobalConfiguration.java index 8e9e3c680..a50129de1 100644 --- a/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/data/GlobalConfiguration.java +++ b/framework/common/src/main/java/edu/kit/kastel/mcse/ardoco/core/data/GlobalConfiguration.java @@ -1,8 +1,8 @@ /* Licensed under MIT 2023-2024. */ package edu.kit.kastel.mcse.ardoco.core.data; -import edu.kit.kastel.mcse.ardoco.core.common.util.SimilarityUtils; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.WordSimUtils; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.SimilarityUtils; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimUtils; import edu.kit.kastel.mcse.ardoco.core.pipeline.Pipeline; /** diff --git a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/ConfusablesHelperTest.java b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/ConfusablesHelperTest.java similarity index 83% rename from framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/ConfusablesHelperTest.java rename to framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/ConfusablesHelperTest.java index 3f303553f..bb9b34090 100644 --- a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/ConfusablesHelperTest.java +++ b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/ConfusablesHelperTest.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -9,6 +9,9 @@ import org.junit.jupiter.api.Test; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ConfusablesHelper; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacter; + public class ConfusablesHelperTest { public static final String example = """ # ! ǃ ⵑ ! diff --git a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimUtilsTest.java b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimUtilsTest.java similarity index 79% rename from framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimUtilsTest.java rename to framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimUtilsTest.java index 09394192c..25deb3657 100644 --- a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/WordSimUtilsTest.java +++ b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/WordSimUtilsTest.java @@ -1,10 +1,12 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.WordSimUtils; + class WordSimUtilsTest { @Test diff --git a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/jarowinkler/JaroWinklerMeasureTest.java b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/jarowinkler/JaroWinklerMeasureTest.java similarity index 87% rename from framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/jarowinkler/JaroWinklerMeasureTest.java rename to framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/jarowinkler/JaroWinklerMeasureTest.java index 7b7c4483e..af9bf7531 100644 --- a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/jarowinkler/JaroWinklerMeasureTest.java +++ b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/jarowinkler/JaroWinklerMeasureTest.java @@ -1,13 +1,15 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.jarowinkler; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.jarowinkler; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.UnicodeCharacterMatchFunctions; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacterMatchFunctions; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.jarowinkler.JaroWinklerMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.jarowinkler.UnicodeJaroWinklerSimilarity; class JaroWinklerMeasureTest { private static final double delta = 0.01; diff --git a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/levenshtein/LevenshteinMeasureTest.java b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/levenshtein/LevenshteinMeasureTest.java similarity index 79% rename from framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/levenshtein/LevenshteinMeasureTest.java rename to framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/levenshtein/LevenshteinMeasureTest.java index 3e5fac546..5b0bbfe49 100644 --- a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/levenshtein/LevenshteinMeasureTest.java +++ b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/levenshtein/LevenshteinMeasureTest.java @@ -1,13 +1,15 @@ /* Licensed under MIT 2023-2024. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.levenshtein; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.levenshtein; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.UnicodeCharacterMatchFunctions; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.UnicodeCharacterMatchFunctions; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.levenshtein.LevenshteinMeasure; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.levenshtein.UnicodeLevenshteinDistance; class LevenshteinMeasureTest { private static final double delta = 0.01; diff --git a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/ngram/NgramMeasureTest.java b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/ngram/NgramMeasureTest.java similarity index 93% rename from framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/ngram/NgramMeasureTest.java rename to framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/ngram/NgramMeasureTest.java index 6315b61ef..b02253915 100644 --- a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/measures/ngram/NgramMeasureTest.java +++ b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/measures/ngram/NgramMeasureTest.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2023. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.measures.ngram; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.ngram; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -11,7 +11,8 @@ import org.apache.commons.text.similarity.LevenshteinDistance; import org.junit.jupiter.api.Test; -import edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.ComparisonContext; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.measures.ngram.NgramMeasure; class NgramMeasureTest { diff --git a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorUtilsTest.java b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorUtilsTest.java similarity index 96% rename from framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorUtilsTest.java rename to framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorUtilsTest.java index 7abf6577f..c0b4696bd 100644 --- a/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/util/wordsim/vector/VectorUtilsTest.java +++ b/framework/common/src/test/java/edu/kit/kastel/mcse/ardoco/core/common/similarity/wordsim/vector/VectorUtilsTest.java @@ -1,5 +1,5 @@ /* Licensed under MIT 2022-2023. */ -package edu.kit.kastel.mcse.ardoco.core.common.util.wordsim.vector; +package edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -11,6 +11,8 @@ import org.junit.jupiter.api.Test; +import edu.kit.kastel.mcse.ardoco.core.common.similarity.wordsim.vector.VectorUtils; + class VectorUtilsTest { record Example(float[] firstVec, float[] secondVec, double expectedCosineSimilarity) {