diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..fb50116
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/src/WordCloud.java b/src/WordCloud.java
index fab3e35..3850ac8 100644
--- a/src/WordCloud.java
+++ b/src/WordCloud.java
@@ -86,7 +86,7 @@ private WordCloud topWords (int numWordsToKeep, int groupSize) {
myTagWords = myTagWords.stream()
// sort from most frequent to least
// TODO: add secondary comparison alphabetically based on word
- .sorted(Comparator.comparing(Entry::getValue).reversed())
+ .sorted(Comparator.comparing(Entry::getValue).reversed().thenComparing(Comparator.comparing(Entry::getKey)))
// keep only the top ones
.limit(numWordsToKeep)
// convert frequencies into groups (Entry is immutable, so create a new one)
@@ -119,6 +119,8 @@ private static List readWords (Scanner input,
Predicate select) {
List contents = Arrays.stream(input.useDelimiter(END_OF_FILE).next().split(WHITESPACE))
// TODO: add map and filter calls using parameters
+ .filter(select)
+ .map(xform)
.collect(Collectors.toList());
input.close();
return contents;