MCPcopy Index your code
hub / github.com/apache/groovy / main

Method main

benchmark/bench/spellcheck.java:8–35  ·  view source on GitHub ↗
(String args[])

Source from the content-addressed store, hash-verified

6
7public class spellcheck {
8 public static void main(String args[]) throws IOException {
9 int n = Integer.parseInt(args[0]);
10 HashMap dict = new HashMap();
11 String word;
12
13 try {
14 BufferedReader in = new BufferedReader(new FileReader("Usr.Dict.Words"));
15 while ((word = in.readLine()) != null) {
16 dict.put(word, new Integer(1));
17 }
18 in.close();
19 } catch (IOException e) {
20 System.err.println(e);
21 return;
22 }
23
24 try {
25 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
26 while ((word = in.readLine()) != null) {
27 if (!dict.containsKey(word)) {
28 System.out.println(word);
29 }
30 }
31 } catch (IOException e) {
32 System.err.println(e);
33 return;
34 }
35 }
36}

Callers

nothing calls this directly

Calls 6

parseIntMethod · 0.80
putMethod · 0.65
closeMethod · 0.65
containsKeyMethod · 0.65
readLineMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected