@@ -0,0 +1,1528 @@
+package week10;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.FileReader;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic class CountWordInstances %7B%0A%0A%09public static void main(String%5B%5D args) throws Exception %7B%0A%0A%09%09Path path = Paths.get(System.getProperty(%22user.dir%22))%0A%09%09%09%09.resolve(%22article.txt%22);%0A%09%09%0A%09%09BufferedReader reader = new BufferedReader(new FileReader(path.toFile()));%0A%09%09%0A%09%09Map%3CString, Integer%3E frequency = new HashMap%3C%3E();%0A%09%0A%09%09String line = reader.readLine();%0A%09%09while(line != null) %7B%0A%09%09%09//System.out.println(%22Processing line: %22 + line);%0A%09%09%09%0A%09%09%09if(!line.trim().equals(%22%22)) %7B%0A%09%09%09%09String %5B%5D words = line.split(%22 %22);%0A%09%09%09%09%0A%09%09%09%09for(String word : words) %7B%0A%09%09%09%09%09if(word == null %7C%7C word.trim().equals(%22%22)) %7B%0A%09%09%09%09%09%09continue;%0A%09%09%09%09%09%7D%0A%09%09%09%09%09String processed = word.toLowerCase();%0A%09%09%09%09%09processed = processed.replace(%22,%22, %22%22);%0A%09%09%09%09%09%0A%09%09%09%09%09if(frequency.containsKey(processed)) %7B%0A%09%09%09%09%09%09frequency.put(processed, %0A%09%09%09%09%09%09%09%09frequency.get(processed) + 1);%0A%09%09%09%09%09%7D else %7B%0A%09%09%09%09%09%09frequency.put(processed, 1);%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09line = reader.readLine();%0A%09%09%7D%0A%09%09%0A%09%09%0A%09%09System.out.println(frequency);%0A%09%09%0A%09%09int mostFrequentlyUsed = 0;%0A%09%09String theWord = null;%0A%09%09%0A%09%09for(String word : frequency.keySet()) %7B%0A%09%09%09Integer theVal = frequency.get(word);%0A%09%09%09if(theVal %3E mostFrequentlyUsed) %7B%0A%09%09%09%09mostFrequentlyUsed = theVal;%0A%09%09%09%09theWord = word;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09System.out.println();%0A%09%09System.out.printf(%22the most frequently used word is '%25s', %25d times%22, %0A%09%09%09%09theWord, mostFrequentlyUsed);%0A%09%09%0A%09%7D%0A%0A%7D%0A

Create CountWordInstances.java