ConvertLowerCase0909.java
1.54 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**
*
*/
package is2.util;
import is2.data.SentenceData09;
import is2.io.CONLLReader09;
import is2.io.CONLLWriter09;
/**
* @author Dr. Bernd Bohnet, 01.03.2010
*
*
*/
public class ConvertLowerCase0909 {
public static void main(String args[]) throws Exception {
CONLLReader09 reader = new CONLLReader09(args[0]);
CONLLWriter09 writer = new CONLLWriter09(args[1]);
while (true) {
SentenceData09 i = reader.getNext();
if (i == null)
break;
SentenceData09 i09 = new SentenceData09(i);
i09.createSemantic(i);
for (int k = 0; k < i09.length(); k++) {
i09.lemmas[k] = i09.lemmas[k].toLowerCase();
i09.plemmas[k] = i09.plemmas[k].toLowerCase();
}
writer.write(i09);
}
writer.finishWriting();
}
public static void convert(String source, String target) throws Exception {
CONLLReader09 reader = new CONLLReader09(source);
CONLLWriter09 writer = new CONLLWriter09(target);
while (true) {
SentenceData09 i = reader.getNext();
if (i == null)
break;
SentenceData09 i09 = new SentenceData09(i);
i09.createSemantic(i);
for (int k = 0; k < i09.length(); k++) {
i09.lemmas[k] = i09.lemmas[k].toLowerCase();
i09.plemmas[k] = i09.plemmas[k].toLowerCase();
}
// public SentenceData09(String[] forms, String[] lemmas, String[]
// olemmas,String[] gpos, String[] ppos, String[] labs, int[] heads,
// String[] fillpred) {
// SentenceData09
// SentenceData09 i2 = new SentenceData09(i.forms,
// i.lemmas,i.org_lemmas,);
writer.write(i09);
}
writer.finishWriting();
}
}