-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvislcg3-dep-skeleton.py
67 lines (64 loc) · 1.23 KB
/
vislcg3-dep-skeleton.py
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
import sys;
count = 0;
buffer = '';
def kasitella(buf, count): #{
n_anal = 0;
n_tab = 0;
tag = 'x';
if buf.count('\t\t') > 0: #{
print(buf);
return;
else: #{
for line in buf.split('\n'): #{
if len(line) == 0: #{
continue;
#}
if line[0] == '"': #{
print(line);
tag = 'x';
count = count + 1;
#}
if line[0] == '\t': #{
if line.count(' det'): #{
tag = 'det';
#}
if line.count(' cnjcoo'): #{
tag = 'cc';
#}
if line.count(' cop '): #{
tag = 'cop';
#}
if line.count(' vaux '): #{
tag = 'aux';
#}
if line.count(' adv'): #{
tag = 'advmod';
#}
if line.count(' post'): #{
tag = 'case';
#}
if line.count(' loc attr'): #{
tag = 'amod';
#}
if line.count(' n ') and line.count(' acc'): #{
tag = 'obj';
#}
if line.count(' sent') or line.count(' guio') or line.count(' cm') or line.count(' lquot') or line.count(' rquot'): #{
tag = 'punct';
#}
print('%s @%s #%d->' % (line, tag, count));
tag = 'x';
#}
#}
#}
#}
for line in sys.stdin.readlines(): #{
if line.strip() == '': #{
kasitella(buffer, count);
print('');
count = 0;
buffer = '';
continue;
#}
buffer = buffer + line;
#}