File size: 458 Bytes
05922fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from nltk.corpus import framenet
from sftp.utils.common import VIRTUAL_ROOT
import os
import sys


output_path = sys.argv[1]
rules = [[VIRTUAL_ROOT]]

for fr in framenet.frames():
    rules[0].append(fr.name)
    new_rule = [fr.name]
    for fe in fr.FE:
        new_rule.append(fe)
    rules.append(new_rule)

os.makedirs(os.path.dirname(output_path), exist_ok=True)
with open(output_path, 'w') as fp:
    fp.write('\n'.join(['\t'.join(r) for r in rules]))