From 9e6bef9dc44c059ba12835a6d30fd425129f429e Mon Sep 17 00:00:00 2001 From: solonovamax Date: Thu, 19 Oct 2023 18:19:59 -0400 Subject: [PATCH] Fix benchmarks compilation Signed-off-by: solonovamax --- .../stringsimilarity/EditMeasureBenchmark.kt | 7 +------ .../NormalizedEditMeasureBenchmark.kt | 11 +++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/kt-string-similarity/src/commonBenchmarks/kotlin/ca/solostudios/stringsimilarity/EditMeasureBenchmark.kt b/kt-string-similarity/src/commonBenchmarks/kotlin/ca/solostudios/stringsimilarity/EditMeasureBenchmark.kt index bca87c5..c2e0608 100644 --- a/kt-string-similarity/src/commonBenchmarks/kotlin/ca/solostudios/stringsimilarity/EditMeasureBenchmark.kt +++ b/kt-string-similarity/src/commonBenchmarks/kotlin/ca/solostudios/stringsimilarity/EditMeasureBenchmark.kt @@ -28,10 +28,6 @@ package ca.solostudios.stringsimilarity -import ca.solostudios.stringsimilarity.edit.DamerauLevenshtein -import ca.solostudios.stringsimilarity.edit.LCS -import ca.solostudios.stringsimilarity.edit.Levenshtein -import ca.solostudios.stringsimilarity.edit.OptimalStringAlignment import kotlinx.benchmark.Benchmark import kotlinx.benchmark.BenchmarkMode import kotlinx.benchmark.BenchmarkTimeUnit @@ -48,7 +44,6 @@ class EditMeasureBenchmark { val s1: String = "mysmilarstring" val s2: String = "myawfullysimilarstirng" val damerauLevenshtein = DamerauLevenshtein() - val lcs = LCS() val levenshtein = Levenshtein() val optimalStringAlignment = OptimalStringAlignment() @@ -59,7 +54,7 @@ class EditMeasureBenchmark { @Benchmark fun testLCS(blackhole: Blackhole) { - blackhole.consume(lcs.distance(s1, s2)) + blackhole.consume(LCS.distance(s1, s2)) } @Benchmark diff --git a/kt-string-similarity/src/commonBenchmarks/kotlin/ca/solostudios/stringsimilarity/NormalizedEditMeasureBenchmark.kt b/kt-string-similarity/src/commonBenchmarks/kotlin/ca/solostudios/stringsimilarity/NormalizedEditMeasureBenchmark.kt index f26a09d..f19d04c 100644 --- a/kt-string-similarity/src/commonBenchmarks/kotlin/ca/solostudios/stringsimilarity/NormalizedEditMeasureBenchmark.kt +++ b/kt-string-similarity/src/commonBenchmarks/kotlin/ca/solostudios/stringsimilarity/NormalizedEditMeasureBenchmark.kt @@ -28,10 +28,10 @@ package ca.solostudios.stringsimilarity -import ca.solostudios.stringsimilarity.edit.NormalizedDamerauLevenshtein -import ca.solostudios.stringsimilarity.edit.NormalizedLCS -import ca.solostudios.stringsimilarity.edit.NormalizedLevenshtein -import ca.solostudios.stringsimilarity.edit.NormalizedOptimalStringAlignment +import ca.solostudios.stringsimilarity.normalized.NormalizedDamerauLevenshtein +import ca.solostudios.stringsimilarity.normalized.NormalizedLCS +import ca.solostudios.stringsimilarity.normalized.NormalizedLevenshtein +import ca.solostudios.stringsimilarity.normalized.NormalizedOptimalStringAlignment import kotlinx.benchmark.Benchmark import kotlinx.benchmark.BenchmarkMode import kotlinx.benchmark.BenchmarkTimeUnit @@ -48,7 +48,6 @@ class NormalizedEditMeasureBenchmark { val s1: String = "mysmilarstring" val s2: String = "myawfullysimilarstirng" val damerauLevenshtein = NormalizedDamerauLevenshtein() - val lcs = NormalizedLCS() val levenshtein = NormalizedLevenshtein() val optimalStringAlignment = NormalizedOptimalStringAlignment() @@ -59,7 +58,7 @@ class NormalizedEditMeasureBenchmark { @Benchmark fun testNormalizedLCS(blackhole: Blackhole) { - blackhole.consume(lcs.distance(s1, s2)) + blackhole.consume(NormalizedLCS.distance(s1, s2)) } @Benchmark