forked from hegenova/Quiz_3_Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSigs2WordsList.java
More file actions
33 lines (28 loc) · 765 Bytes
/
Copy pathSigs2WordsList.java
File metadata and controls
33 lines (28 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Set;
public class Sigs2WordsList {
public static void main(String[] args) throws FileNotFoundException {
ArrayList<String> list;
new DictionaryListImpl();
if (args.length == 0) {
list = new ArrayList<String>();
Scanner scan = new Scanner(System.in);
while (scan.hasNext()) {
list.add(scan.next());
}
scan.close();
}
else {
list = new ArrayList<String>(Arrays.asList(args));
}
if (list.isEmpty() == false) {
for (String s: list) {
Set<String> words = DictionaryListImpl.signatureToWords(s);
System.out.println(s + " : " + words);
}
}
}
}