Skip to content

Commit

Permalink
remove unused test
Browse files Browse the repository at this point in the history
  • Loading branch information
vietnguyengit committed Mar 22, 2024
1 parent c104d50 commit c8bf27e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
11 changes: 0 additions & 11 deletions indexer/src/main/java/au/org/aodn/esindexer/utils/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> generateTitleSuggest(String input) {
Set<String> 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());

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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
Expand Down

0 comments on commit c8bf27e

Please sign in to comment.