forked from carltonnorthern/nicknames
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JavaParser.java
29 lines (26 loc) · 1.05 KB
/
JavaParser.java
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
public Map<String, String> dimNames = new HashMap<String, String>();
private void loadDiminutiveNames() {
BufferedReader input = null;
try {
input = new BufferedReader(new FileReader(dimNamesFile));
String line = null;
while ((line = input.readLine()) != null) {
//System.out.println("line = " + line);
StringTokenizer st = new StringTokenizer(line, ",");
String key = st.nextToken();
List<String> values = new ArrayList<String>();
while (st.hasMoreElements()) {
values.add(st.nextToken());
}
dimNames.put(key, values);
}
} catch (IOException ex) {
Logger.getLogger(ThisClass.class.getName()).log(Level.SEVERE, null, ex);
} finally {
try {
input.close();
} catch (IOException ex) {
Logger.getLogger(ThisClass.class.getName()).log(Level.SEVERE, null, ex);
}
}
}