From 0da45dfaf5a613d0220bfb49d858651e538266c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 6 Apr 2018 14:32:04 +0200 Subject: [PATCH] exo5: fix the submapping with filter displaying. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- exo5/Main.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exo5/Main.java b/exo5/Main.java index f8fac79..37692ef 100644 --- a/exo5/Main.java +++ b/exo5/Main.java @@ -46,12 +46,12 @@ class Main { System.out.println("Word \"" + wordCursor + "\" occured " + sm.get(wordCursor) + " times"); } - System.out.println("Map content of duplicates inferior to the word \"milieu\":"); + System.out.println("Map content of exaclty duplicated word inferior to the word \"milieu\":"); Map m1 = tm.entrySet().stream() .filter(map -> map.getKey().compareTo("milieu") < 0 && map.getValue() == 2) .collect(Collectors.toMap(p -> p.getKey(), p -> p.getValue())); for (String wordCursor : m1.keySet()) { - System.out.println("Word \"" + wordCursor + "\" occured " + sm.get(wordCursor) + " times"); + System.out.println("Word \"" + wordCursor + "\" occured " + m1.get(wordCursor) + " times"); } System.out.println("Map content of duplicates with occurence between 2 and 5:"); @@ -59,7 +59,7 @@ class Main { .filter(map -> map.getValue() >= 2 && map.getValue() <= 5) .collect(Collectors.toMap(p -> p.getKey(), p -> p.getValue())); for (String wordCursor : m2.keySet()) { - System.out.println("Word \"" + wordCursor + "\" occured " + sm.get(wordCursor) + " times"); + System.out.println("Word \"" + wordCursor + "\" occured " + m2.get(wordCursor) + " times"); } } } -- 2.34.1