From c8bf27e3681c2a3ec6b4e19b075f272f3a0bf33a Mon Sep 17 00:00:00 2001 From: Viet Nguyen Date: Fri, 22 Mar 2024 12:30:24 +1100 Subject: [PATCH] remove unused test --- .../java/au/org/aodn/esindexer/utils/StringUtil.java | 11 ----------- .../au/org/aodn/esindexer/utils/StringUtilTest.java | 7 ------- 2 files changed, 18 deletions(-) diff --git a/indexer/src/main/java/au/org/aodn/esindexer/utils/StringUtil.java b/indexer/src/main/java/au/org/aodn/esindexer/utils/StringUtil.java index 0f9258b2..5d1899fe 100644 --- a/indexer/src/main/java/au/org/aodn/esindexer/utils/StringUtil.java +++ b/indexer/src/main/java/au/org/aodn/esindexer/utils/StringUtil.java @@ -14,15 +14,4 @@ public class StringUtil { public static String encodeUTF8(String input) { return new String(input.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); } - - public static List generateTitleSuggest(String input) { - Set uniqueWords = new HashSet<>(); - // Filter out stop words - return Arrays.stream(input.replaceAll("[^a-zA-Z0-9]", " ").split("\\s+")) - .map(String::toLowerCase) - .filter(word -> !AppConstants.STOP_WORDS.contains(word)) - .filter(uniqueWords::add) - .collect(Collectors.toList()); - - } } diff --git a/indexer/src/test/java/au/org/aodn/esindexer/utils/StringUtilTest.java b/indexer/src/test/java/au/org/aodn/esindexer/utils/StringUtilTest.java index 4d63d8e2..bf0615dd 100644 --- a/indexer/src/test/java/au/org/aodn/esindexer/utils/StringUtilTest.java +++ b/indexer/src/test/java/au/org/aodn/esindexer/utils/StringUtilTest.java @@ -24,13 +24,6 @@ public void testToUTF8String_withFrenchCharacters() { assertEquals(frenchString, result); } - @Test - void generateTitleSuggest() { - String input = "IMOS - Animal Tracking Facility - Satellite Relay Tagging Program - Delayed mode data °"; - List result = StringUtil.generateTitleSuggest(input); - assertEquals(List.of("imos", "animal", "tracking", "facility", "satellite", "relay", "tagging", "program", "delayed", "mode", "data"), result); - } - @Test public void testToUTF8String_withDegreeSign() { // Example string containing the degree symbol