diff --git a/Sorting/RandomWordFileReader.java b/Sorting/RandomWordFileReader.java index 85a8297..a04c02c 100644 --- a/Sorting/RandomWordFileReader.java +++ b/Sorting/RandomWordFileReader.java @@ -14,7 +14,7 @@ public class RandomWordFileReader { public RandomWordFileReader(String filename){ try(BufferedReader reader = Files.newBufferedReader(Path.of(filename));){ //This should use flatMap to make a string array from the line, and then turn the elements of that array into a stream, which goes to forEach - reader.lines().flatMap(line -> Arrays.stream(line.split("\\s+"))).forEach(word -> words.add(word)); + reader.lines().flatMap(line -> Arrays.stream(line.split("\\s+"))).forEach(word -> words.add(word.toLowerCase())); }catch (IOException ex){ System.err.println(ex); }